opendistro-for-elasticsearch / k-NN

🆕 A machine learning plugin which supports an approximate k-NN search algorithm for Open Distro.

Home Page:https://opendistro.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to get all documents within a particular score of 'knn'?

geethaaluri opened this issue · comments

Hi, I am new to elastic search. I am trying to use the score script functionality to

  1. Get all candidates with score > 0.769

Issue: My script below currently returns only 10 candidates.

search_body_scored = {
    "min_score":0.769,
    "docvalue_fields": [
        "_id"
      ],
     "query": {
       "script_score": {
         "query": {
           "match_all": {"boost" : 1}
         },
         "script": {
           "source": "knn_score",
           "lang": "knn",
           "params": {
               "field": "feature_vector",
               "vector": image_vector,
                "space_type": "l2"
           }
         }
       }
     }
}

What is the best way to get all the results for the score condition?