# Is it possible to get start position of highlighted value? (end position as well) and \_score filter also

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-get-start-position-of-highlighted-value-end-position-as-well-and-score-filter-also/357380>\
**Category:** Elasticsearch\
**Created:** [April 15, 2024, 1:10am UTC](https://discuss.elastic.co/t/is-it-possible-to-get-start-position-of-highlighted-value-end-position-as-well-and-score-filter-also/357380 "2024-04-15T01:10:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sojoong.dev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sojoong.dev/32/133514_2.png) [@sojoong.dev](https://discuss.elastic.co/u/sojoong.dev)\
**Post date:** [April 15, 2024, 1:10am UTC](https://discuss.elastic.co/t/is-it-possible-to-get-start-position-of-highlighted-value-end-position-as-well-and-score-filter-also/357380/1 "2024-04-15T01:10:16Z")

</div>

Hi.  
First of all, Here is the query...

```auto
GET /my_doc/_search
{
  "query": {
    "function_score": {
      "query": {
        "bool": {
          "must": [
            {
              "multi_match": {
                "query": "keyword",
                "fields": ["title^3", "content^1"],
                "tie_breaker": 0.3
              }
            }
          ],
          "filter": [
            {
              "terms": {
                "company": ["John Doe"]
              }
            }
          ]
        }
      }
    }
  },
  "highlight": {
    "order": "score",
    "fields": {
      "title": {},
      "content": {}
    }
  },
  "track_scores": true,

  "from": 0,
  "size": 10
}

```

Once I search with this query, there are highlighted values in the results.  
And I just want to know this highlighted value's start position and end position in the original document. I am just wondering is it possible and if it's possible let me know how to get it.

And the other question is that how to filter returned results with \_score value.

Forexamle, This is a result.

```auto
"hits": [
      {
        "_index": "my_doc",
        "_id": "11194",
        "_score": 31.323647,
         ....
      },
      {
        "_index": "my_doc",
        "_id": "10560",
        "_score": 12.19738,
         ....
      },
      {
        "_index": "my_doc",
        "_id": "12849",
        "_score": 11.530414,
         ....
      },

```

And I want to filter with \_score value range. (\_score \<=10 && \_score\<=20)  
If it's possible let me know how to write query please.

Thanks in advance.  
Have a good day
