Closed vamshin closed 4 years ago
After fix
{
"took" : 158,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 3,
"relation" : "eq"
},
"max_score" : 0.012012012,
"hits" : [
{
"_index" : "my_index",
"_type" : "_doc",
"_id" : "1",
"_score" : 0.012012012,
"_source" : {
"my_dense_vector" : [
0.5,
10,
6
],
"status" : "published"
}
},
{
"_index" : "my_index",
"_type" : "_doc",
"_id" : "2",
"_score" : 0.0073937154,
"_source" : {
"my_dense_vector" : [
-0.5,
10,
10
],
"status" : "published"
}
},
{
"_index" : "my_index",
"_type" : "_doc",
"_id" : "3",
"_score" : 1.4E-45, // No vector in this doc, so assigned Float.MIN
"_source" : {
"status" : "published"
}
}
]
}
}
KNN script would corrupt results if the document that is filtered part of query does not contain the vector.
Steps to reproduce:-
Result:- Score for the doc id 3 should be Float.Min as it does not contain the vector but the score of the previous document gets carried over in this case