ES 8.8
When I write data for a period of time, using knn search results can not be found, but can use term search results; At this time, I put this part of the data to update_by_query, and then use the same knn search, there are results, do not know what is the cause;
knn search
GET my_index/_search?routing=xxxx
{
"knn": {
"field": "text_vector",
"query_vector": [xxxxx],
"k": 10,
"num_candidates": 100,
"filter": {
"terms": {
"code": [
"xxxx"
]
}
}
},
"_source": {
"excludes": "text_vector"
}
}
term search
{
"query": {
"term": {
"code": {
"value": "xxx"
}
}
}
}
update_by_query
POST my_index/_update_by_query?routing=xxx&refresh=true
{
"query": {
"term": {
"code": {
"value": "xxx"
}
}
}
}