# Highlighting in Elasticsearch for Exact phrase

**URL:** <https://discuss.elastic.co/t/highlighting-in-elasticsearch-for-exact-phrase/79097>\
**Category:** Elasticsearch\
**Created:** [March 17, 2017, 9:17pm UTC](https://discuss.elastic.co/t/highlighting-in-elasticsearch-for-exact-phrase/79097 "2017-03-17T21:17:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashit\_pupu](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ashit_pupu/32/101113_2.png) [@ashit\_pupu](https://discuss.elastic.co/u/ashit_pupu)\
**Post date:** [March 17, 2017, 9:17pm UTC](https://discuss.elastic.co/t/highlighting-in-elasticsearch-for-exact-phrase/79097/1 "2017-03-17T21:17:53Z")

</div>

0  
down vote  
favorite  
I am trying to do exact phrase search in Elasticsearch , but I am facing a issue in obtaining the complete document. My doc has a field

```
   "bkgcontent" :[ "qucik brown fox",
                   "quick brown fox jumped high",
                   "not related text"]

```

I am doing a phrase search and using query

```
              GET /_search
              {
               "query" : {
"match_phrase": { "bkgcontent": "qucik brown fox" }
                  },
 "highlight" : {
 "pre_tags" : ["<span style='font-weight: bold;'>"],
 "post_tags" : ["</span>"],
 "number_of_fragments" : 0,
 "fields" : {
  "bkgdcontent" : { }
 }
}

```

The result I get has

```
"highlight": {
"bkgcontent" :[ "<span style='font-weight: bold;'>qucik brown fox</span>",
               "<span style='font-weight: bold;'>quick brown fox jumped high</span>"]

```

}  
The issue is I am missing the third value which is not related text. Is there any way I can obtain the third value in in the highlight segment only rather than doing a manual look up.

After going through lots of documentation figured out that I can use "no\_match\_size": to get the data snippets which is not having any match.I have tried using that but it was of no use. Confused now !!!!  
Any help will be great .

---

<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:** [March 24, 2017, 3:11pm UTC](https://discuss.elastic.co/t/highlighting-in-elasticsearch-for-exact-phrase/79097/2 "2017-03-24T15:11:05Z")

</div>

I don't believe what you are looking for is supported. `no_match_size` is for returning a snippet at the start of some text when there isn't a match in that section.

---

<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:** [April 21, 2017, 3:11pm UTC](https://discuss.elastic.co/t/highlighting-in-elasticsearch-for-exact-phrase/79097/3 "2017-04-21T15:11:25Z")

</div>

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