# Highlight behaviour

**URL:** <https://discuss.elastic.co/t/highlight-behaviour/199354>\
**Category:** Elasticsearch\
**Created:** [September 13, 2019, 3:51am UTC](https://discuss.elastic.co/t/highlight-behaviour/199354 "2019-09-13T03:51:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gowd](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gowd/32/42180_2.png) [@Gowd](https://discuss.elastic.co/u/Gowd)\
**Post date:** [September 13, 2019, 3:51am UTC](https://discuss.elastic.co/t/highlight-behaviour/199354/1 "2019-09-13T03:51:45Z")

</div>

Referring to [https://www.elastic.co/guide/en/elasticsearch//reference/current/search-request-body.html#request-body-search-highlighting](https://www.elastic.co/guide/en/elasticsearch//reference/current/search-request-body.html#request-body-search-highlighting)

The note says,

> Highlighters don’t reflect the boolean logic of a query when extracting terms to highlight. Thus, for some complex boolean queries (e.g nested boolean queries, queries using `minimum_should_match` etc.), parts of documents may be highlighted that don’t correspond to query matches.

Is there a work around to achieve this? I am relying on highlights to figure out which query completely matched in boolean logic. But it is not the right way to use it as I see.

---

<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:** [October 11, 2019, 3:51am UTC](https://discuss.elastic.co/t/highlight-behaviour/199354/2 "2019-10-11T03:51:46Z")

</div>

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