# Accessing \_score in filter section of a function of function\_score

**URL:** https://discuss.elastic.co/t/accessing--score-in-filter-section-of-a-function-of-function-score/75752
**Category:** Elasticsearch
**Created:** [February 20, 2017, 2:03pm UTC](https://discuss.elastic.co/t/accessing--score-in-filter-section-of-a-function-of-function-score/75752 "2017-02-20T14:03:42Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![zahir\_koradia](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zahir_koradia/32/15692_2.png) [@zahir\_koradia](https://discuss.elastic.co/u/zahir_koradia)
#### Post date: [February 20, 2017, 2:03pm UTC](https://discuss.elastic.co/t/accessing--score-in-filter-section-of-a-function-of-function-score/75752/1 "2017-02-20T14:03:42Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [March 20, 2017, 2:03pm UTC](https://discuss.elastic.co/t/accessing--score-in-filter-section-of-a-function-of-function-score/75752/2 "2017-03-20T14:03:47Z")

</div>

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