Accessing _score in filter section of a function of function_score

Is it possible to access _score when I am filtering the documents in the function_score section? Sample query below.

GET /_search
{
   "query": {
      "function_score": {
         "query": {
            "bool": {
               "filter": [
                  {}
               ],
               "must": [
                  {
                     "dis_max": {
                        "tie_breaker": 0,
                        "queries": [
                           {
                              "match": {
                                 "service": "events"
                              }
                           },
                           {
                              "match": {
                                 "brand": "events"
                              }
                           }
                        ]
                     }
                  }
               ]
            }
         },
         "functions": [
            {
               "filter": {
                  "range": {
                     "_score": {
                        "lte": 10
                     }
                  }
               },
               "script_score": {
                  "script": {
                      "inline": "_score * 2"
                  }
               }
            }
         ],
      }
   }
}

It doesnt seem to work. In general is there a way to filter documents on _score? I would like to apply lower bound (available through min_score) and upper bound (don't know how to do this).

Thanks.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.