Milvus vector search with scalar filtering returns different results between v2.3.12 and v2.4.17 #43807
-
|
I want to ask about vector search with scalar filtering. # pymilvus 2.4.15
search_params = {
"metric_type": "IP",
"params": {"nprobe": 10}
}
top_k = 1
results = collection.search(
data=[input_vector],
anns_field="vector",
param=search_params,
limit=top_k,
expr=f"user_id in [11927]",
output_fields=["id", "user_id"],
round_decimal=3
)
print(results)I tested with two Milvus server (same data). 1. Milvus 2.3.12 (standalone)results
2. Milvus 2.4.17 (cluster)results
My questions:1. When performing a query with scalar filtering, how does Milvus process it?
2. What is the difference between the two Milvus versions above that could cause such different results?3. How to optimize the above query, list of user IDs can have 1–2 thousand elements? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
|
could you try latest 2.5.16 and verify the results? |
Beta Was this translation helpful? Give feedback.
-
|
milvus will usually apply filter first, and then send the bitset to vector index https://milvus.io/docs/bitset.md. There are maybe several possibilities:
|
Beta Was this translation helpful? Give feedback.
yes, you are correct