vector-databasemilvus

Milvus standalone query operations return empty


I setup Milvus standalone. Wrote a client app to connect to the milvus server. Following quickstart guide. Insert operaeare successful. However, query operations returns empty. What could be the reason for this. No filter. I am just returning all items in a collection.


Solution

  • The visibility of data for search/query is mainly controlled by the consistency level: https://milvus.io/docs/consistency.md#Consistency

    Milvus manages data consistency by time-tick machinery: https://milvus.io/docs/time_sync.md#Time-Synchronization. The root coordinator sends a time-tick for each 200ms, and each "data-channel" will receive the time-tick messages. Once a time-tick message is accepted by all the datanodes and querynodes, we can say the data before this time point is visible and searchable.

    When you call the search() or query() interface, you can set the consistency level with the following options: "Strong" ------Wait until all data is consumed by query nodes so that all the data is visible. This option will add 200ms ~ 400ms to search latency.

    "Bounded" ----Allows data within a time window(5 seconds) to be invisible.If some data out of the time window is not consumed, it will wait a while.

    "Eventually" -----Execute search/query immediately without checking consistency. No extra latency is added. Some data might be invisible.

    Example:

     results = collection.search(
                     data=target_vectors,
                     anns_field="vector",
                     limit=50,
                     consistency_level="Strong",
                 )
    
    res = collection.query(expr="id < 8",
                        output_fields=["vector"],
                        consistency_level="Strong",
                    )
    

    https://milvus.io/docs/consistency.md

    https://milvus.io/docs/time_sync.md