# Question about highlight query

**URL:** <https://discuss.elastic.co/t/question-about-highlight-query/21359>\
**Category:** Elasticsearch\
**Created:** [December 22, 2014, 10:27pm UTC](https://discuss.elastic.co/t/question-about-highlight-query/21359 "2014-12-22T22:27:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yang\_Liu](https://avatars.discourse-cdn.com/v4/letter/y/fbc32d/32.png) [@Yang\_Liu](https://discuss.elastic.co/u/Yang_Liu)\
**Post date:** [December 22, 2014, 10:27pm UTC](https://discuss.elastic.co/t/question-about-highlight-query/21359/1 "2014-12-22T22:27:57Z")

</div>

Hi, guys,  
I have a question about highlight query in ES.  
_Below is my query,_  
{  
"\_source": [

.....  
],  
"highlight": {  
"fields": {  
"FDS\_ATTACHMENTS": {  
"type": "plain"  
},  
"FDS\_ATTACHMENTS.no\_stem": {  
"type": "plain"  
},  
"FDS\_ATTACHMENTS.with\_case": {  
"type": "plain"  
},  
"headline": {  
"type": "plain"  
},  
"headline.no\_stem": {  
"type": "plain"  
},  
"headline.with\_case": {  
"type": "plain"  
}  
},  
"fragment\_size": 500,  
"highlight\_query": {  
"bool": {  
"must": [  
{  
"bool": {  
"minimum\_should\_match": 1,  
"should": [  
{  
"span\_near": {  
"clauses": [  
{  
"span\_term": {  
"FDS\_ATTACHMENTS.no\_stem": "rights"  
}  
},  
{  
"span\_term": {  
"FDS\_ATTACHMENTS.no\_stem": "agreement"  
}  
}  
],  
"in\_order": true,  
"slop": 0  
}  
}  
]  
}  
},  
{  
"bool": {  
"minimum\_should\_match": 1,  
"should": [  
{  
"span\_near": {  
"clauses": [  
{  
"span\_term": {  
"FDS\_ATTACHMENTS.no\_stem": "rights"  
}  
},  
{  
"span\_term": {  
"FDS\_ATTACHMENTS.no\_stem": "agreement"  
}  
},  
{  
"span\_term": {  
"FDS\_ATTACHMENTS.no\_stem": "merger"  
}  
}  
],  
"in\_order": false,  
"slop": 5  
}  
}  
]  
}  
}  
]  
}  
},  
"number\_of\_fragments": 50,  
"post\_tags": [  
""  
],  
"pre\_tags": [  
""  
],  
"require\_field\_match": true  
},  
"query": {  
"filtered": {  
"filter": {  
"range": {  
"story\_datetime": {  
"gte": "20141221t000000",  
"lte": "20141222t235959"  
}  
}  
},  
"query": {  
"bool": {  
"must": [  
{  
"bool": {  
"minimum\_should\_match": 1,  
"should": [  
{  
"span\_near": {  
"clauses": [  
{  
"span\_term": {  
"FDS\_ATTACHMENTS.no\_stem": "rights"  
}  
},  
{  
"span\_term": {  
"FDS\_ATTACHMENTS.no\_stem": "agreement"  
}  
}  
],  
"in\_order": true,  
"slop": 0  
}  
},  
{  
"span\_near": {  
"clauses": [  
{  
"span\_term": {  
"headline.no\_stem": "rights"  
}  
},  
{  
"span\_term": {  
"headline.no\_stem": "agreement"  
}  
}  
],  
"in\_order": true,  
"slop": 0  
}  
},  
{  
"span\_near": {  
"clauses": [  
{  
"span\_term": {  
"headline2.no\_stem": "rights"  
}  
},  
{  
"span\_term": {  
"headline2.no\_stem": "agreement"  
}  
}  
],  
"in\_order": true,  
"slop": 0  
}  
}  
]  
}  
},  
{  
"bool": {  
"minimum\_should\_match": 1,  
"should": [  
{  
"span\_near": {  
"clauses": [  
{  
"span\_term": {  
"FDS\_ATTACHMENTS.no\_stem": "rights"  
}  
},  
{  
"span\_term": {  
"FDS\_ATTACHMENTS.no\_stem": "agreement"  
}  
},  
{  
"span\_term": {  
"FDS\_ATTACHMENTS.no\_stem": "merger"  
}  
}  
],  
"in\_order": false,  
"slop": 5  
}  
},  
{  
"span\_near": {  
"clauses": [  
{  
"span\_term": {  
"headline.no\_stem": "rights"  
}  
},  
{  
"span\_term": {  
"headline.no\_stem": "agreement"  
}  
},  
{  
"span\_term": {  
"headline.no\_stem": "merger"  
}  
}  
],  
"in\_order": false,  
"slop": 5  
}  
},  
{  
"span\_near": {  
"clauses": [  
{  
"span\_term": {  
"headline2.no\_stem": "rights"  
}  
},  
{  
"span\_term": {  
"headline2.no\_stem": "agreement"  
}  
},  
{  
"span\_term": {  
"headline2.no\_stem": "merger"  
}  
}  
],  
"in\_order": false,  
"slop": 5  
}  
}  
]  
}  
}  
]  
}  
}  
}  
},  
"size": 50,  
"sort": [  
{  
"\_score": {  
"ignore\_unmapped": true,  
"order": "desc"  
}  
},  
{  
"story\_datetime": {  
"order": "desc"  
}  
}  
]  
}

And here is a response I got,

- of the Transactions set forth in the Offering Memorandum, and  
redeeming the Notes, if applicable and (d) conducting such other activities  
as are necessary or appropriate to carry out the activities described  
above. Prior to the Merger Date, the Company shall not own, hold or  
otherwise have any interest in any material assets other than cash and cash  
equivalents and its rights and obligations under the  
Merger Agreement.  
ARTICLE 5. SUCCESSORS Section 5.01

You could see that the slop between rights and Agreement are definitely more than 0, not adjacent at all!  
Could someone give me suggestions that how I can change the query to make  
sure that in all the segments, rights and agreement are adjacent.  
I have set the slop to be 0 in the highlight query, and I don't know why ES  
not skip this segment, since it does not match the criteria.

Thank you very much!

--  
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/691af78c-5f9a-46f3-a54a-895421c1e28e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/691af78c-5f9a-46f3-a54a-895421c1e28e%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Yang\_Liu](https://avatars.discourse-cdn.com/v4/letter/y/fbc32d/32.png) [@Yang\_Liu](https://discuss.elastic.co/u/Yang_Liu)\
**Post date:** [December 23, 2014, 5:44pm UTC](https://discuss.elastic.co/t/question-about-highlight-query/21359/2 "2014-12-23T17:44:37Z")

</div>

No one knows anything about this? I really appreciate anything you offered.

On Monday, December 22, 2014 5:27:57 PM UTC-5, Yang Liu wrote:

> Hi, guys,  
> I have a question about highlight query in ES.  
> _Below is my query,_  
> {  
> "\_source": [
> 
> .....  
> ],  
> "highlight": {  
> "fields": {  
> "FDS\_ATTACHMENTS": {  
> "type": "plain"  
> },  
> "FDS\_ATTACHMENTS.no\_stem": {  
> "type": "plain"  
> },  
> "FDS\_ATTACHMENTS.with\_case": {  
> "type": "plain"  
> },  
> "headline": {  
> "type": "plain"  
> },  
> "headline.no\_stem": {  
> "type": "plain"  
> },  
> "headline.with\_case": {  
> "type": "plain"  
> }  
> },  
> "fragment\_size": 500,  
> "highlight\_query": {  
> "bool": {  
> "must": [  
> {  
> "bool": {  
> "minimum\_should\_match": 1,  
> "should": [  
> {  
> "span\_near": {  
> "clauses": [  
> {  
> "span\_term": {  
> "FDS\_ATTACHMENTS.no\_stem": "rights"  
> }  
> },  
> {  
> "span\_term": {  
> "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> }  
> }  
> ],  
> "in\_order": true,  
> "slop": 0  
> }  
> }  
> ]  
> }  
> },  
> {  
> "bool": {  
> "minimum\_should\_match": 1,  
> "should": [  
> {  
> "span\_near": {  
> "clauses": [  
> {  
> "span\_term": {  
> "FDS\_ATTACHMENTS.no\_stem": "rights"  
> }  
> },  
> {  
> "span\_term": {  
> "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> }  
> },  
> {  
> "span\_term": {  
> "FDS\_ATTACHMENTS.no\_stem": "merger"  
> }  
> }  
> ],  
> "in\_order": false,  
> "slop": 5  
> }  
> }  
> ]  
> }  
> }  
> ]  
> }  
> },  
> "number\_of\_fragments": 50,  
> "post\_tags": [  
> ""  
> ],  
> "pre\_tags": [  
> ""  
> ],  
> "require\_field\_match": true  
> },  
> "query": {  
> "filtered": {  
> "filter": {  
> "range": {  
> "story\_datetime": {  
> "gte": "20141221t000000",  
> "lte": "20141222t235959"  
> }  
> }  
> },  
> "query": {  
> "bool": {  
> "must": [  
> {  
> "bool": {  
> "minimum\_should\_match": 1,  
> "should": [  
> {  
> "span\_near": {  
> "clauses": [  
> {  
> "span\_term": {  
> "FDS\_ATTACHMENTS.no\_stem": "rights"  
> }  
> },  
> {  
> "span\_term": {  
> "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> }  
> }  
> ],  
> "in\_order": true,  
> "slop": 0  
> }  
> },  
> {  
> "span\_near": {  
> "clauses": [  
> {  
> "span\_term": {  
> "headline.no\_stem": "rights"  
> }  
> },  
> {  
> "span\_term": {  
> "headline.no\_stem": "agreement"  
> }  
> }  
> ],  
> "in\_order": true,  
> "slop": 0  
> }  
> },  
> {  
> "span\_near": {  
> "clauses": [  
> {  
> "span\_term": {  
> "headline2.no\_stem": "rights"  
> }  
> },  
> {  
> "span\_term": {  
> "headline2.no\_stem": "agreement"  
> }  
> }  
> ],  
> "in\_order": true,  
> "slop": 0  
> }  
> }  
> ]  
> }  
> },  
> {  
> "bool": {  
> "minimum\_should\_match": 1,  
> "should": [  
> {  
> "span\_near": {  
> "clauses": [  
> {  
> "span\_term": {  
> "FDS\_ATTACHMENTS.no\_stem": "rights"  
> }  
> },  
> {  
> "span\_term": {  
> "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> }  
> },  
> {  
> "span\_term": {  
> "FDS\_ATTACHMENTS.no\_stem": "merger"  
> }  
> }  
> ],  
> "in\_order": false,  
> "slop": 5  
> }  
> },  
> {  
> "span\_near": {  
> "clauses": [  
> {  
> "span\_term": {  
> "headline.no\_stem": "rights"  
> }  
> },  
> {  
> "span\_term": {  
> "headline.no\_stem": "agreement"  
> }  
> },  
> {  
> "span\_term": {  
> "headline.no\_stem": "merger"  
> }  
> }  
> ],  
> "in\_order": false,  
> "slop": 5  
> }  
> },  
> {  
> "span\_near": {  
> "clauses": [  
> {  
> "span\_term": {  
> "headline2.no\_stem": "rights"  
> }  
> },  
> {  
> "span\_term": {  
> "headline2.no\_stem": "agreement"  
> }  
> },  
> {  
> "span\_term": {  
> "headline2.no\_stem": "merger"  
> }  
> }  
> ],  
> "in\_order": false,  
> "slop": 5  
> }  
> }  
> ]  
> }  
> }  
> ]  
> }  
> }  
> }  
> },  
> "size": 50,  
> "sort": [  
> {  
> "\_score": {  
> "ignore\_unmapped": true,  
> "order": "desc"  
> }  
> },  
> {  
> "story\_datetime": {  
> "order": "desc"  
> }  
> }  
> ]  
> }
> 
> And here is a response I got,
> 
> - of the Transactions set forth in the Offering Memorandum, and  
> redeeming the Notes, if applicable and (d) conducting such other activities  
> as are necessary or appropriate to carry out the activities described  
> above. Prior to the Merger Date, the Company shall not own, hold or  
> otherwise have any interest in any material assets other than cash and cash  
> equivalents and its rights and obligations under the  
> Merger Agreement.  
> ARTICLE 5. SUCCESSORS Section 5.01
> 
> You could see that the slop between rights and Agreement are definitely more than 0, not adjacent at  
> all!  
> Could someone give me suggestions that how I can change the query to make  
> sure that in all the segments, rights and agreement are adjacent.  
> I have set the slop to be 0 in the highlight query, and I don't know why  
> ES not skip this segment, since it does not match the criteria.
> 
> Thank you very much!

--  
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/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [December 31, 2014, 3:38pm UTC](https://discuss.elastic.co/t/question-about-highlight-query/21359/3 "2014-12-31T15:38:13Z")

</div>

Highlighting isn't a nice pretty thing - its kind of a hacky. There are  
three highlighters built in  
[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html)  
to Elasticsearch and they all work differently. You should try all of them  
and see if they do what you want. They all come at the problem from a  
different perspective and have their own idiosyncrasies. I maintain a  
highlighter  
plugin [https://github.com/wikimedia/search-highlighter](https://github.com/wikimedia/search-highlighter) as well that you  
can use as a forth option. It merges lots of the implementation strategies  
that the other ones use together and attempts to give you more options and  
it might do what you need.

Nik

On Tue, Dec 23, 2014 at 12:44 PM, Yang Liu [yl916@nyu.edu](mailto:yl916@nyu.edu) wrote:

> No one knows anything about this? I really appreciate anything you offered.
> 
> On Monday, December 22, 2014 5:27:57 PM UTC-5, Yang Liu wrote:
> 
> > Hi, guys,  
> > I have a question about highlight query in ES.  
> > _Below is my query,_  
> > {  
> > "\_source": [
> > 
> > .....  
> > ],  
> > "highlight": {  
> > "fields": {  
> > "FDS\_ATTACHMENTS": {  
> > "type": "plain"  
> > },  
> > "FDS\_ATTACHMENTS.no\_stem": {  
> > "type": "plain"  
> > },  
> > "FDS\_ATTACHMENTS.with\_case": {  
> > "type": "plain"  
> > },  
> > "headline": {  
> > "type": "plain"  
> > },  
> > "headline.no\_stem": {  
> > "type": "plain"  
> > },  
> > "headline.with\_case": {  
> > "type": "plain"  
> > }  
> > },  
> > "fragment\_size": 500,  
> > "highlight\_query": {  
> > "bool": {  
> > "must": [  
> > {  
> > "bool": {  
> > "minimum\_should\_match": 1,  
> > "should": [  
> > {  
> > "span\_near": {  
> > "clauses": [  
> > {  
> > "span\_term": {  
> > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > }  
> > }  
> > ],  
> > "in\_order": true,  
> > "slop": 0  
> > }  
> > }  
> > ]  
> > }  
> > },  
> > {  
> > "bool": {  
> > "minimum\_should\_match": 1,  
> > "should": [  
> > {  
> > "span\_near": {  
> > "clauses": [  
> > {  
> > "span\_term": {  
> > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "FDS\_ATTACHMENTS.no\_stem": "merger"  
> > }  
> > }  
> > ],  
> > "in\_order": false,  
> > "slop": 5  
> > }  
> > }  
> > ]  
> > }  
> > }  
> > ]  
> > }  
> > },  
> > "number\_of\_fragments": 50,  
> > "post\_tags": [  
> > ""  
> > ],  
> > "pre\_tags": [  
> > ""  
> > ],  
> > "require\_field\_match": true  
> > },  
> > "query": {  
> > "filtered": {  
> > "filter": {  
> > "range": {  
> > "story\_datetime": {  
> > "gte": "20141221t000000",  
> > "lte": "20141222t235959"  
> > }  
> > }  
> > },  
> > "query": {  
> > "bool": {  
> > "must": [  
> > {  
> > "bool": {  
> > "minimum\_should\_match": 1,  
> > "should": [  
> > {  
> > "span\_near": {  
> > "clauses": [  
> > {  
> > "span\_term": {  
> > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > }  
> > }  
> > ],  
> > "in\_order": true,  
> > "slop": 0  
> > }  
> > },  
> > {  
> > "span\_near": {  
> > "clauses": [  
> > {  
> > "span\_term": {  
> > "headline.no\_stem": "rights"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "headline.no\_stem": "agreement"  
> > }  
> > }  
> > ],  
> > "in\_order": true,  
> > "slop": 0  
> > }  
> > },  
> > {  
> > "span\_near": {  
> > "clauses": [  
> > {  
> > "span\_term": {  
> > "headline2.no\_stem": "rights"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "headline2.no\_stem": "agreement"  
> > }  
> > }  
> > ],  
> > "in\_order": true,  
> > "slop": 0  
> > }  
> > }  
> > ]  
> > }  
> > },  
> > {  
> > "bool": {  
> > "minimum\_should\_match": 1,  
> > "should": [  
> > {  
> > "span\_near": {  
> > "clauses": [  
> > {  
> > "span\_term": {  
> > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "FDS\_ATTACHMENTS.no\_stem": "merger"  
> > }  
> > }  
> > ],  
> > "in\_order": false,  
> > "slop": 5  
> > }  
> > },  
> > {  
> > "span\_near": {  
> > "clauses": [  
> > {  
> > "span\_term": {  
> > "headline.no\_stem": "rights"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "headline.no\_stem": "agreement"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "headline.no\_stem": "merger"  
> > }  
> > }  
> > ],  
> > "in\_order": false,  
> > "slop": 5  
> > }  
> > },  
> > {  
> > "span\_near": {  
> > "clauses": [  
> > {  
> > "span\_term": {  
> > "headline2.no\_stem": "rights"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "headline2.no\_stem": "agreement"  
> > }  
> > },  
> > {  
> > "span\_term": {  
> > "headline2.no\_stem": "merger"  
> > }  
> > }  
> > ],  
> > "in\_order": false,  
> > "slop": 5  
> > }  
> > }  
> > ]  
> > }  
> > }  
> > ]  
> > }  
> > }  
> > }  
> > },  
> > "size": 50,  
> > "sort": [  
> > {  
> > "\_score": {  
> > "ignore\_unmapped": true,  
> > "order": "desc"  
> > }  
> > },  
> > {  
> > "story\_datetime": {  
> > "order": "desc"  
> > }  
> > }  
> > ]  
> > }
> > 
> > And here is a response I got,
> > 
> > - of the Transactions set forth in the Offering Memorandum, and  
> > redeeming the Notes, if applicable and (d) conducting such other activities  
> > as are necessary or appropriate to carry out the activities described  
> > above. Prior to the Merger Date, the Company shall not own, hold or  
> > otherwise have any interest in any material assets other than cash and cash  
> > equivalents and its rights and obligations under the  
> > Merger Agreement.  
> > ARTICLE 5. SUCCESSORS Section 5.01
> > 
> > You could see that the slop between rights and Agreement are definitely more than 0, not adjacent at  
> > all!  
> > Could someone give me suggestions that how I can change the query to make  
> > sure that in all the segments, rights and agreement are adjacent.  
> > I have set the slop to be 0 in the highlight query, and I don't know why  
> > ES not skip this segment, since it does not match the criteria.
> > 
> > Thank you very much!
> > 
> > --  
> > 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/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> 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/CAPmjWd0PyNZ%2BZKhoRX6YqfNkZnctu9NsVsuZGh0yvudU3xDGLw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0PyNZ%2BZKhoRX6YqfNkZnctu9NsVsuZGh0yvudU3xDGLw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Itamar\_Syn\_Hershko](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/itamar_syn_hershko/32/725_2.png) [@Itamar\_Syn\_Hershko](https://discuss.elastic.co/u/Itamar_Syn_Hershko)\
**Post date:** [January 1, 2015, 11:03pm UTC](https://discuss.elastic.co/t/question-about-highlight-query/21359/4 "2015-01-01T23:03:40Z")

</div>

A bit off-topic, but I'd really like to see is the ability to perform  
highlighting asynchronously, that is - first get the search results from  
Elsaticsearch, process them and get the highlighted snippets on a second  
wave, asynchronously.

The main problem with highlighting currently is that it is slow - because  
of hackish recursive algorithms and mandatory I/O access. I'd like to avoid  
doing 2-step searches (one search for the results, the other one is to  
artificially propagate the highlights to the UI on a "second wave" - I  
wonder if we can come up with a way to have ES propagate them  
asynchronously for us?

--

Itamar Syn-Hershko  
[http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
Freelance Developer & Consultant  
Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)

On Wed, Dec 31, 2014 at 5:38 PM, Nikolas Everett [nik9000@gmail.com](mailto:nik9000@gmail.com) wrote:

> Highlighting isn't a nice pretty thing - its kind of a hacky. There are  
> three highlighters built in  
> [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html)  
> to Elasticsearch and they all work differently. You should try all of them  
> and see if they do what you want. They all come at the problem from a  
> different perspective and have their own idiosyncrasies. I maintain a highlighter  
> plugin [https://github.com/wikimedia/search-highlighter](https://github.com/wikimedia/search-highlighter) as well that you  
> can use as a forth option. It merges lots of the implementation strategies  
> that the other ones use together and attempts to give you more options and  
> it might do what you need.
> 
> Nik
> 
> On Tue, Dec 23, 2014 at 12:44 PM, Yang Liu [yl916@nyu.edu](mailto:yl916@nyu.edu) wrote:
> 
> > No one knows anything about this? I really appreciate anything you  
> > offered.
> > 
> > On Monday, December 22, 2014 5:27:57 PM UTC-5, Yang Liu wrote:
> > 
> > > Hi, guys,  
> > > I have a question about highlight query in ES.  
> > > _Below is my query,_  
> > > {  
> > > "\_source": [
> > > 
> > > .....  
> > > ],  
> > > "highlight": {  
> > > "fields": {  
> > > "FDS\_ATTACHMENTS": {  
> > > "type": "plain"  
> > > },  
> > > "FDS\_ATTACHMENTS.no\_stem": {  
> > > "type": "plain"  
> > > },  
> > > "FDS\_ATTACHMENTS.with\_case": {  
> > > "type": "plain"  
> > > },  
> > > "headline": {  
> > > "type": "plain"  
> > > },  
> > > "headline.no\_stem": {  
> > > "type": "plain"  
> > > },  
> > > "headline.with\_case": {  
> > > "type": "plain"  
> > > }  
> > > },  
> > > "fragment\_size": 500,  
> > > "highlight\_query": {  
> > > "bool": {  
> > > "must": [  
> > > {  
> > > "bool": {  
> > > "minimum\_should\_match": 1,  
> > > "should": [  
> > > {  
> > > "span\_near": {  
> > > "clauses": [  
> > > {  
> > > "span\_term": {  
> > > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > > }  
> > > }  
> > > ],  
> > > "in\_order": true,  
> > > "slop": 0  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > },  
> > > {  
> > > "bool": {  
> > > "minimum\_should\_match": 1,  
> > > "should": [  
> > > {  
> > > "span\_near": {  
> > > "clauses": [  
> > > {  
> > > "span\_term": {  
> > > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "FDS\_ATTACHMENTS.no\_stem": "merger"  
> > > }  
> > > }  
> > > ],  
> > > "in\_order": false,  
> > > "slop": 5  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > },  
> > > "number\_of\_fragments": 50,  
> > > "post\_tags": [  
> > > ""  
> > > ],  
> > > "pre\_tags": [  
> > > ""  
> > > ],  
> > > "require\_field\_match": true  
> > > },  
> > > "query": {  
> > > "filtered": {  
> > > "filter": {  
> > > "range": {  
> > > "story\_datetime": {  
> > > "gte": "20141221t000000",  
> > > "lte": "20141222t235959"  
> > > }  
> > > }  
> > > },  
> > > "query": {  
> > > "bool": {  
> > > "must": [  
> > > {  
> > > "bool": {  
> > > "minimum\_should\_match": 1,  
> > > "should": [  
> > > {  
> > > "span\_near": {  
> > > "clauses": [  
> > > {  
> > > "span\_term": {  
> > > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > > }  
> > > }  
> > > ],  
> > > "in\_order": true,  
> > > "slop": 0  
> > > }  
> > > },  
> > > {  
> > > "span\_near": {  
> > > "clauses": [  
> > > {  
> > > "span\_term": {  
> > > "headline.no\_stem": "rights"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "headline.no\_stem": "agreement"  
> > > }  
> > > }  
> > > ],  
> > > "in\_order": true,  
> > > "slop": 0  
> > > }  
> > > },  
> > > {  
> > > "span\_near": {  
> > > "clauses": [  
> > > {  
> > > "span\_term": {  
> > > "headline2.no\_stem": "rights"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "headline2.no\_stem": "agreement"  
> > > }  
> > > }  
> > > ],  
> > > "in\_order": true,  
> > > "slop": 0  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > },  
> > > {  
> > > "bool": {  
> > > "minimum\_should\_match": 1,  
> > > "should": [  
> > > {  
> > > "span\_near": {  
> > > "clauses": [  
> > > {  
> > > "span\_term": {  
> > > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "FDS\_ATTACHMENTS.no\_stem": "merger"  
> > > }  
> > > }  
> > > ],  
> > > "in\_order": false,  
> > > "slop": 5  
> > > }  
> > > },  
> > > {  
> > > "span\_near": {  
> > > "clauses": [  
> > > {  
> > > "span\_term": {  
> > > "headline.no\_stem": "rights"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "headline.no\_stem": "agreement"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "headline.no\_stem": "merger"  
> > > }  
> > > }  
> > > ],  
> > > "in\_order": false,  
> > > "slop": 5  
> > > }  
> > > },  
> > > {  
> > > "span\_near": {  
> > > "clauses": [  
> > > {  
> > > "span\_term": {  
> > > "headline2.no\_stem": "rights"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "headline2.no\_stem": "agreement"  
> > > }  
> > > },  
> > > {  
> > > "span\_term": {  
> > > "headline2.no\_stem": "merger"  
> > > }  
> > > }  
> > > ],  
> > > "in\_order": false,  
> > > "slop": 5  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > }  
> > > ]  
> > > }  
> > > }  
> > > }  
> > > },  
> > > "size": 50,  
> > > "sort": [  
> > > {  
> > > "\_score": {  
> > > "ignore\_unmapped": true,  
> > > "order": "desc"  
> > > }  
> > > },  
> > > {  
> > > "story\_datetime": {  
> > > "order": "desc"  
> > > }  
> > > }  
> > > ]  
> > > }
> > > 
> > > And here is a response I got,
> > > 
> > > - of the Transactions set forth in the Offering Memorandum, and  
> > > redeeming the Notes, if applicable and (d) conducting such other activities  
> > > as are necessary or appropriate to carry out the activities described  
> > > above. Prior to the Merger Date, the Company shall not own, hold or  
> > > otherwise have any interest in any material assets other than cash and cash  
> > > equivalents and its rights and obligations under the  
> > > Merger Agreement.  
> > > ARTICLE 5. SUCCESSORS Section 5.01
> > > 
> > > You could see that the slop between rights and Agreement are definitely more than 0, not adjacent at  
> > > all!  
> > > Could someone give me suggestions that how I can change the query to  
> > > make sure that in all the segments, rights and agreement are adjacent.  
> > > I have set the slop to be 0 in the highlight query, and I don't know why  
> > > ES not skip this segment, since it does not match the criteria.
> > > 
> > > Thank you very much!
> > > 
> > > --  
> > > 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/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > 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/CAPmjWd0PyNZ%2BZKhoRX6YqfNkZnctu9NsVsuZGh0yvudU3xDGLw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0PyNZ%2BZKhoRX6YqfNkZnctu9NsVsuZGh0yvudU3xDGLw%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0PyNZ%2BZKhoRX6YqfNkZnctu9NsVsuZGh0yvudU3xDGLw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0PyNZ%2BZKhoRX6YqfNkZnctu9NsVsuZGh0yvudU3xDGLw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> 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/CAHTr4ZuOyebnTiFJ%2B3MNVP5-nb8\_U0HZRJ%2BXP%2Bbu4QrroDQ%2B1w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZuOyebnTiFJ%2B3MNVP5-nb8_U0HZRJ%2BXP%2Bbu4QrroDQ%2B1w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [January 2, 2015, 12:19am UTC](https://discuss.elastic.co/t/question-about-highlight-query/21359/5 "2015-01-02T00:19:54Z")

</div>

I imagine you could repeat a search replacing the query with ID searches  
and provide the search in the highlight query. I don't know how efficient  
it'd be.

You could give the experimental highlighter a try for speed. Its generally  
the fastest option I've tried and I don't believe it has any funky  
recursive algorithms, though I think phrase detection isn't too quick but  
at least its optional and less prone to crazy then the fvh. It also  
minimizes io by giving you the option of doing hit detection using any of  
the three methods used by the other highlighters. So you can reananlyze  
short fields, use postings for some, and term vectors for others. You can  
chose which one to use on the fly if you like too.

All and all I bet there are use cases where it'd make more sense to delay  
highlighting - like fetching a chunk of results and only doing the  
highlighting when the user scrolls to make the result visible. Or  
something.

Nik  
On Jan 1, 2015 6:03 PM, "Itamar Syn-Hershko" [itamar@code972.com](mailto:itamar@code972.com) wrote:

> A bit off-topic, but I'd really like to see is the ability to perform  
> highlighting asynchronously, that is - first get the search results from  
> Elsaticsearch, process them and get the highlighted snippets on a second  
> wave, asynchronously.
> 
> The main problem with highlighting currently is that it is slow - because  
> of hackish recursive algorithms and mandatory I/O access. I'd like to avoid  
> doing 2-step searches (one search for the results, the other one is to  
> artificially propagate the highlights to the UI on a "second wave" - I  
> wonder if we can come up with a way to have ES propagate them  
> asynchronously for us?
> 
> --
> 
> Itamar Syn-Hershko  
> [http://code972.com](http://code972.com) | @synhershko [https://twitter.com/synhershko](https://twitter.com/synhershko)  
> Freelance Developer & Consultant  
> Author of RavenDB in Action [http://manning.com/synhershko/](http://manning.com/synhershko/)
> 
> On Wed, Dec 31, 2014 at 5:38 PM, Nikolas Everett [nik9000@gmail.com](mailto:nik9000@gmail.com)  
> wrote:
> 
> > Highlighting isn't a nice pretty thing - its kind of a hacky. There are  
> > three highlighters built in  
> > [http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-highlighting.html)  
> > to Elasticsearch and they all work differently. You should try all of them  
> > and see if they do what you want. They all come at the problem from a  
> > different perspective and have their own idiosyncrasies. I maintain a highlighter  
> > plugin [https://github.com/wikimedia/search-highlighter](https://github.com/wikimedia/search-highlighter) as well that  
> > you can use as a forth option. It merges lots of the implementation  
> > strategies that the other ones use together and attempts to give you more  
> > options and it might do what you need.
> > 
> > Nik
> > 
> > On Tue, Dec 23, 2014 at 12:44 PM, Yang Liu [yl916@nyu.edu](mailto:yl916@nyu.edu) wrote:
> > 
> > > No one knows anything about this? I really appreciate anything you  
> > > offered.
> > > 
> > > On Monday, December 22, 2014 5:27:57 PM UTC-5, Yang Liu wrote:
> > > 
> > > > Hi, guys,  
> > > > I have a question about highlight query in ES.  
> > > > _Below is my query,_  
> > > > {  
> > > > "\_source": [
> > > > 
> > > > .....  
> > > > ],  
> > > > "highlight": {  
> > > > "fields": {  
> > > > "FDS\_ATTACHMENTS": {  
> > > > "type": "plain"  
> > > > },  
> > > > "FDS\_ATTACHMENTS.no\_stem": {  
> > > > "type": "plain"  
> > > > },  
> > > > "FDS\_ATTACHMENTS.with\_case": {  
> > > > "type": "plain"  
> > > > },  
> > > > "headline": {  
> > > > "type": "plain"  
> > > > },  
> > > > "headline.no\_stem": {  
> > > > "type": "plain"  
> > > > },  
> > > > "headline.with\_case": {  
> > > > "type": "plain"  
> > > > }  
> > > > },  
> > > > "fragment\_size": 500,  
> > > > "highlight\_query": {  
> > > > "bool": {  
> > > > "must": [  
> > > > {  
> > > > "bool": {  
> > > > "minimum\_should\_match": 1,  
> > > > "should": [  
> > > > {  
> > > > "span\_near": {  
> > > > "clauses": [  
> > > > {  
> > > > "span\_term": {  
> > > > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > > > }  
> > > > }  
> > > > ],  
> > > > "in\_order": true,  
> > > > "slop": 0  
> > > > }  
> > > > }  
> > > > ]  
> > > > }  
> > > > },  
> > > > {  
> > > > "bool": {  
> > > > "minimum\_should\_match": 1,  
> > > > "should": [  
> > > > {  
> > > > "span\_near": {  
> > > > "clauses": [  
> > > > {  
> > > > "span\_term": {  
> > > > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "FDS\_ATTACHMENTS.no\_stem": "merger"  
> > > > }  
> > > > }  
> > > > ],  
> > > > "in\_order": false,  
> > > > "slop": 5  
> > > > }  
> > > > }  
> > > > ]  
> > > > }  
> > > > }  
> > > > ]  
> > > > }  
> > > > },  
> > > > "number\_of\_fragments": 50,  
> > > > "post\_tags": [  
> > > > ""  
> > > > ],  
> > > > "pre\_tags": [  
> > > > ""  
> > > > ],  
> > > > "require\_field\_match": true  
> > > > },  
> > > > "query": {  
> > > > "filtered": {  
> > > > "filter": {  
> > > > "range": {  
> > > > "story\_datetime": {  
> > > > "gte": "20141221t000000",  
> > > > "lte": "20141222t235959"  
> > > > }  
> > > > }  
> > > > },  
> > > > "query": {  
> > > > "bool": {  
> > > > "must": [  
> > > > {  
> > > > "bool": {  
> > > > "minimum\_should\_match": 1,  
> > > > "should": [  
> > > > {  
> > > > "span\_near": {  
> > > > "clauses": [  
> > > > {  
> > > > "span\_term": {  
> > > > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > > > }  
> > > > }  
> > > > ],  
> > > > "in\_order": true,  
> > > > "slop": 0  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_near": {  
> > > > "clauses": [  
> > > > {  
> > > > "span\_term": {  
> > > > "headline.no\_stem": "rights"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "headline.no\_stem": "agreement"  
> > > > }  
> > > > }  
> > > > ],  
> > > > "in\_order": true,  
> > > > "slop": 0  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_near": {  
> > > > "clauses": [  
> > > > {  
> > > > "span\_term": {  
> > > > "headline2.no\_stem": "rights"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "headline2.no\_stem": "agreement"  
> > > > }  
> > > > }  
> > > > ],  
> > > > "in\_order": true,  
> > > > "slop": 0  
> > > > }  
> > > > }  
> > > > ]  
> > > > }  
> > > > },  
> > > > {  
> > > > "bool": {  
> > > > "minimum\_should\_match": 1,  
> > > > "should": [  
> > > > {  
> > > > "span\_near": {  
> > > > "clauses": [  
> > > > {  
> > > > "span\_term": {  
> > > > "FDS\_ATTACHMENTS.no\_stem": "rights"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "FDS\_ATTACHMENTS.no\_stem": "agreement"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "FDS\_ATTACHMENTS.no\_stem": "merger"  
> > > > }  
> > > > }  
> > > > ],  
> > > > "in\_order": false,  
> > > > "slop": 5  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_near": {  
> > > > "clauses": [  
> > > > {  
> > > > "span\_term": {  
> > > > "headline.no\_stem": "rights"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "headline.no\_stem": "agreement"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "headline.no\_stem": "merger"  
> > > > }  
> > > > }  
> > > > ],  
> > > > "in\_order": false,  
> > > > "slop": 5  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_near": {  
> > > > "clauses": [  
> > > > {  
> > > > "span\_term": {  
> > > > "headline2.no\_stem": "rights"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "headline2.no\_stem": "agreement"  
> > > > }  
> > > > },  
> > > > {  
> > > > "span\_term": {  
> > > > "headline2.no\_stem": "merger"  
> > > > }  
> > > > }  
> > > > ],  
> > > > "in\_order": false,  
> > > > "slop": 5  
> > > > }  
> > > > }  
> > > > ]  
> > > > }  
> > > > }  
> > > > ]  
> > > > }  
> > > > }  
> > > > }  
> > > > },  
> > > > "size": 50,  
> > > > "sort": [  
> > > > {  
> > > > "\_score": {  
> > > > "ignore\_unmapped": true,  
> > > > "order": "desc"  
> > > > }  
> > > > },  
> > > > {  
> > > > "story\_datetime": {  
> > > > "order": "desc"  
> > > > }  
> > > > }  
> > > > ]  
> > > > }
> > > > 
> > > > And here is a response I got,
> > > > 
> > > > - of the Transactions set forth in the Offering Memorandum, and  
> > > > redeeming the Notes, if applicable and (d) conducting such other activities  
> > > > as are necessary or appropriate to carry out the activities described  
> > > > above. Prior to the Merger Date, the Company shall not own, hold or  
> > > > otherwise have any interest in any material assets other than cash and cash  
> > > > equivalents and its rights and obligations under the  
> > > > Merger Agreement.  
> > > > ARTICLE 5. SUCCESSORS Section 5.01
> > > > 
> > > > You could see that the slop between rights and Agreement are definitely more than 0, not adjacent at  
> > > > all!  
> > > > Could someone give me suggestions that how I can change the query to  
> > > > make sure that in all the segments, rights and agreement are adjacent.  
> > > > I have set the slop to be 0 in the highlight query, and I don't know  
> > > > why ES not skip this segment, since it does not match the criteria.
> > > > 
> > > > Thank you very much!
> > > > 
> > > > --  
> > > > 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/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/e35c12fd-a8bb-4edd-825d-f846eaeb02c4%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .
> > > 
> > > 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/CAPmjWd0PyNZ%2BZKhoRX6YqfNkZnctu9NsVsuZGh0yvudU3xDGLw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0PyNZ%2BZKhoRX6YqfNkZnctu9NsVsuZGh0yvudU3xDGLw%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0PyNZ%2BZKhoRX6YqfNkZnctu9NsVsuZGh0yvudU3xDGLw%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd0PyNZ%2BZKhoRX6YqfNkZnctu9NsVsuZGh0yvudU3xDGLw%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .  
> > 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/CAHTr4ZuOyebnTiFJ%2B3MNVP5-nb8\_U0HZRJ%2BXP%2Bbu4QrroDQ%2B1w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZuOyebnTiFJ%2B3MNVP5-nb8_U0HZRJ%2BXP%2Bbu4QrroDQ%2B1w%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZuOyebnTiFJ%2B3MNVP5-nb8\_U0HZRJ%2BXP%2Bbu4QrroDQ%2B1w%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAHTr4ZuOyebnTiFJ%2B3MNVP5-nb8_U0HZRJ%2BXP%2Bbu4QrroDQ%2B1w%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .  
> 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/CAPmjWd29sAkwZxtHtHgV7NkCkbZDpFcr9FkxjHathbwn6CXYzw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd29sAkwZxtHtHgV7NkCkbZDpFcr9FkxjHathbwn6CXYzw%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:41am UTC](https://discuss.elastic.co/t/question-about-highlight-query/21359/6 "2017-07-06T00:41:13Z")

</div>


