# Highliting the field

**URL:** https://discuss.elastic.co/t/highliting-the-field/20937
**Category:** Elasticsearch
**Created:** [November 25, 2014, 2:09pm UTC](https://discuss.elastic.co/t/highliting-the-field/20937 "2014-11-25T14:09:30Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![pavan\_530530](https://avatars.discourse-cdn.com/v4/letter/p/b19c9b/32.png) [@pavan\_530530](https://discuss.elastic.co/u/pavan_530530)
#### Post date: [November 25, 2014, 2:09pm UTC](https://discuss.elastic.co/t/highliting-the-field/20937/1 "2014-11-25T14:09:30Z")

</div>

hi.. i am trying to highlight the comment but its getting highlight of my "comment" field as well as "appstore\_name" field content also.. this is my query:

curl -XGET 'localhost:9200/gold.reviews/\_search?pretty' -d'{  
"query":{  
"bool":{  
"must":[{"match":{"appstore\_name":{"query":"apple app store","operator":"and"}}},{"range":{"date":{"from":"2013-11-01","to":"2014-11-20"}}}],  
"must":[{"match":{"comment":"wifi"}},{"match":{"title":"wifi"}}],"minimum\_should\_match":1}},"highlight":{"fields":{"comment":{}}}}'

**output:**

"hits" : {  
"total" : 2,  
"max\_score" : 3.236876,  
"hits" : [ {  
"\_index" : "gold.reviews",  
"\_type" : "string",  
"\_id" : "1364990543",  
"\_score" : 3.236876,  
"\_source":{"comment": "The gold app is not connecting via home wifi and working on away from home mode... Plz help", "rating": 1, "title": "Not connecting to home wifi", "appstore\_name": "Apple App Store", "country\_name": "India", "version": "1.5.0", "user": "Tanuj1992", "time": "00:00:00", "date": "2014-08-26", "iso\_code": "IN", "application\_name": "gold"},  
"highlight" : {  
"comment" : ["The gold _app_ is not connecting via home _wifi_ and working on away from home mode... Plz help"]

i dont want to highlight "app" word..i want to highlight only "wifi".. help me out of this asap..

---

<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: [November 26, 2014, 1:34pm UTC](https://discuss.elastic.co/t/highliting-the-field/20937/2 "2014-11-26T13:34:56Z")

</div>

Highlighting extracts terms from the query and your query contains the  
words apple app store. You can fix this by providing a highlight\_query or  
by setting another setting who's name I've forgotten. I believe it is  
require\_field\_match or something.  
On Nov 26, 2014 6:27 AM, "pavan.530530" [pavan.530530@gmail.com](mailto:pavan.530530@gmail.com) wrote:

> hi.. i am trying to highlight the comment but its getting highlight of my  
> "comment" field as well as "appstore\_name" field content also.. this is my  
> query:
> 
> curl -XGET 'localhost:9200/gold.reviews/\_search?pretty' -d'{  
> "query":{  
> "bool":{  
> "must":[{"match":{"appstore\_name":{"query":"apple app
> 
> store","operator":"and"}}},{"range":{"date":{"from":"2013-11-01","to":"2014-11-20"}}}],
> 
> "must":[{"match":{"comment":"wifi"}},{"match":{"title":"wifi"}}],"minimum\_should\_match":1}},"highlight":{"fields":{"comment":{}}}}'
> 
> _output:_
> 
> "hits" : {  
> "total" : 2,  
> "max\_score" : 3.236876,  
> "hits" : [ {  
> "\_index" : "gold.reviews",  
> "\_type" : "string",  
> "\_id" : "1364990543",  
> "\_score" : 3.236876,  
> "\_source":{"comment": "The gold app is not connecting via home wifi  
> and working on away from home mode... Plz help", "rating": 1, "title": "Not  
> connecting to home wifi", "appstore\_name": "Apple App Store",  
> "country\_name": "India", "version": "1.5.0", "user": "Tanuj1992", "time":  
> "00:00:00", "date": "2014-08-26", "iso\_code": "IN", "application\_name":  
> "gold"},  
> "highlight" : {  
> "comment" : [ "The gold _app_ is not connecting via home  
> _wifi_ and working on away from home mode... Plz help" ]
> 
> i dont want to highlight "app" word..i want to highlight only "wifi"..  
> help  
> me out of this asap..
> 
> --  
> View this message in context:  
> [http://elasticsearch-users.115913.n3.nabble.com/highliting-the-field-tp4066746.html](http://elasticsearch-users.115913.n3.nabble.com/highliting-the-field-tp4066746.html)  
> Sent from the Elasticsearch Users mailing list archive at [Nabble.com](http://Nabble.com).
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1416924570489-4066746.post%40n3.nabble.com](https://groups.google.com/d/msgid/elasticsearch/1416924570489-4066746.post%40n3.nabble.com)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1D79VA%3DeeJdi85e-4eV%3DgJWk9203a85rzYXv0QzG-PFg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1D79VA%3DeeJdi85e-4eV%3DgJWk9203a85rzYXv0QzG-PFg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:47am UTC](https://discuss.elastic.co/t/highliting-the-field/20937/3 "2017-07-06T00:47:29Z")

</div>


