Java SDK中使用MilvusClientV2的search(SearchReq request)方法返回的结果中score字段名变成了distance
Closed this issue · 3 comments
wangsheng23576 commented
Java SDK中使用MilvusClientV2的search(SearchReq request)方法返回的结果如下:
{
"searchResults": [
[{
"distance": 1.4093276,
"id": "UUID202405301234567891",
"entity": {}
}, {
"distance": 0.99021345,
"id": "UUID202405301234567895",
"entity": {}
}, {
"distance": 0.85199434,
"id": "UUID202405301234567892",
"entity": {}
}, {
"distance": 0.79723436,
"id": "UUID202405301234567896",
"entity": {}
}, {
"distance": 0.59287345,
"id": "UUID202405301234567893",
"entity": {}
}, {
"distance": 0.4527678,
"id": "UUID202405301234567894",
"entity": {}
}]
]
}
但是在文档和attu的返回结果如下:
代码返回的“distance”字段名应该是“score”。
yhmo commented
这名字其实不重要,不管是score还是distance其实都不是好名字。
wangsheng23576 commented
这名字其实不重要,不管是score还是distance其实都不是好名字。
明白了,不同的metric获得的值会有区别。