# Is it possible to highlight only match\_phrase query?

**URL:** <https://discuss.elastic.co/t/is-it-possible-to-highlight-only-match-phrase-query/32802>\
**Category:** Elasticsearch\
**Created:** [October 22, 2015, 7:00pm UTC](https://discuss.elastic.co/t/is-it-possible-to-highlight-only-match-phrase-query/32802 "2015-10-22T19:00:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cshah](https://avatars.discourse-cdn.com/v4/letter/c/76d3ee/32.png) [@cshah](https://discuss.elastic.co/u/cshah)\
**Post date:** [October 22, 2015, 7:00pm UTC](https://discuss.elastic.co/t/is-it-possible-to-highlight-only-match-phrase-query/32802/1 "2015-10-22T19:00:12Z")

</div>

Hi,

I have a bool query like this

```
{
  "query": {
    "bool": {
      "must": [
        {
          "terms": {
            "type": [
              "bill",
              "press release"
            ]
          }
        },
        {
          "match_phrase": {
            "title": "health"
          }
        }
      ]
    }
  },
  "highlight": {
    "fields": {
      "policy_content": {}
    }
  },
  "sort": [
    {
      "publishdate": {
        "order": "desc"
      }
    }
  ]
}

```

User is searching for the word health and I only want to highlight "health" but 'bill' and 'press releases" also gets highlighted, How should I address this problem?

Thank You

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [October 22, 2015, 7:11pm UTC](https://discuss.elastic.co/t/is-it-possible-to-highlight-only-match-phrase-query/32802/2 "2015-10-22T19:11:47Z")

</div>

You can do that with [highlight\_query](https://www.elastic.co/guide/en/elasticsearch/reference/1.7/search-request-highlighting.html#_highlight_query).

---

<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:** [July 5, 2017, 11:43pm UTC](https://discuss.elastic.co/t/is-it-possible-to-highlight-only-match-phrase-query/32802/3 "2017-07-05T23:43:08Z")

</div>


