Open NicoYuan1986 opened 4 days ago
I believe this is a test issue as we set IP metric for sparse vector, while trying to search it by cosine. @binbinlv I thin this was somehow caused by init_collection_general(), please help to take a look /assign @binbinlv /unassign
I believe this is a test issue as we set IP metric for sparse vector, while trying to search it by cosine. @binbinlv I thin this was somehow caused by init_collection_general(), please help to take a look /assign @binbinlv /unassign
working on it.
I think this is not a test case issue.
Milvus should use the metric type defined when creating index automatically if not specifying metric type again in search params.
But here it did not use the correct metric type defined in the index params when not specifying it in search params for sparse vector.
It used "COSINE" while set the "IP" when creating index for sparse vector.
This case is good in master-latest image, while it is failed in 2.4 latest (2.4-20240923-b92daa15)
/assign @zhengbuqian
this is not specific to sparse float vector.
If we have 2 vector indexes with different types of metric, and when searching if we omit the metric type in the search request, the inferred metric type will always be the first index.
search_params = {} # did not specify metric_type
# col1: [vec_ip, vec_cosine]:
col1.search(query, "vec_ip", search_params) # ok
col1.search(query, "vec_cosine", search_params) # not ok: expected cosine, actual ip
working on a fix
the bug was introduced by #36279: collection metric was used if not provided in search params
if req.Req.MetricType == "" {
req.Req.MetricType = collection.GetMetricType()
}
/assign @SimFG /unassign
can you help fix this?
/unassign
Is there an existing issue for this?
Environment
Current Behavior
Search failed reporting metric type not match with no metric type specified.
Expected Behavior
pass
Steps To Reproduce
No response
Milvus Log
Anything else?
I try locally. Here is index params:
Here is search params:
It should use default index metric type rather than report error.