Closed SourabhTirodkar closed 3 years ago
Hi @SourabhTirodkar,
boost to kNN search can be achieved through function_score. In the below example i am boosting the score by 2.
curl -X POST "localhost:9200/myindex/_search" -H 'Content-Type: application/json' -d'
{
"size" : 2,
"query": {
"bool": {
"must": [
{
"function_score": {
"query": {
"knn": {
"my_vector": {
"vector": [7, 8],
"k": 2
}
}
},
"weight": 2
}
},
]
}
}
}
'
Is there a possibility of including a boost factor for KNN search ?