Bruce REN
Bruce REN

Reputation: 25

Milvus, similarity search by vector id

I am trying to conduct a vector similarity search via vector's raw id (VarChar type).

For example, a vector consists of three fields :
auto_id (int64), userId (VarChar), vectorField (FloatVector).

One possible solution in my mind is like:

  1. Retrieve the vector field vector1 of user1 by a query;
  2. Conduct another search operation over vector to retrieve the topK vectors in milvus.

Is is possible that, given userId = "uid1", retrieve the topK vectors by a single query/search

Upvotes: 1

Views: 1343

Answers (2)

BarzanHayati
BarzanHayati

Reputation: 959

Milvus 2.4 includes support for retrieving entities by userID.

Get Entities by userID

    res = client.get(
        collection_name="quick_setup",
        userId=['0', '1', '2']
    )
    
    print(res)

Get entities from partitions

    res = client.get(
        collection_name="quick_setup",
        userId=['1000', '1001', '1002'],
        partition_names=["partitionA"]
    )
    
    print(res)

Upvotes: 0

coolflower
coolflower

Reputation: 77

milvus does not currently support search by id.

Mainly milvus is used to do ann calculation, search by id function is more suitable for key-value database

Upvotes: 1

Related Questions