mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
fix: deduce metric type from non-empty search result (#44222)
issue: https://github.com/milvus-io/milvus/issues/32262 The old implementation always takes metric type from the first sub result, which may not always be valid. The fixed implementation returns initialized metric type from sub results. Signed-off-by: smdsbz <smdsbz@qq.com>
This commit is contained in:
parent
ecd8fa9b1b
commit
0c9b1597f2
@ -602,9 +602,10 @@ func convertHybridSearchToSearch(req *milvuspb.HybridSearchRequest) *milvuspb.Se
|
||||
}
|
||||
|
||||
func getMetricType(toReduceResults []*internalpb.SearchResults) string {
|
||||
metricType := ""
|
||||
if len(toReduceResults) >= 1 {
|
||||
metricType = toReduceResults[0].GetMetricType()
|
||||
for _, r := range toReduceResults {
|
||||
if m := r.GetMetricType(); m != "" {
|
||||
return m
|
||||
}
|
||||
}
|
||||
return metricType
|
||||
return ""
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user