# Multi match field highlight if all words match

**URL:** <https://discuss.elastic.co/t/multi-match-field-highlight-if-all-words-match/168766>\
**Category:** Elasticsearch\
**Created:** [February 18, 2019, 6:04am UTC](https://discuss.elastic.co/t/multi-match-field-highlight-if-all-words-match/168766 "2019-02-18T06:04:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anjireddy543](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@anjireddy543](https://discuss.elastic.co/u/anjireddy543)\
**Post date:** [February 18, 2019, 6:04am UTC](https://discuss.elastic.co/t/multi-match-field-highlight-if-all-words-match/168766/1 "2019-02-18T06:04:22Z")

</div>

Hi,

i am having some issue with multi\_match field highlight, here my scenorio

## Query

{  
"multi\_match": {  
"query": "quick brown fox",  
"fields": ["title", "body"],  
"operator":"and",  
"type": "best\_fields" # default  
}  
}

Hightlight type : Plain

## Data

title : quick brown  
body : quick brown fox

## Problem

It needs to highlight only "body" which has all words but its highlighting "quick brown" words also in title also.

---

<div class="post-metadata">

**Author:** ![MarkHendriks](https://avatars.discourse-cdn.com/v4/letter/m/c68b51/32.png) [@MarkHendriks](https://discuss.elastic.co/u/MarkHendriks)\
**Post date:** [February 20, 2019, 7:19pm UTC](https://discuss.elastic.co/t/multi-match-field-highlight-if-all-words-match/168766/2 "2019-02-20T19:19:00Z")

</div>

Try to set the "type" of your "multi\_match" to "phrase".

---

<div class="post-metadata">

**Author:** ![anjireddy543](https://avatars.discourse-cdn.com/v4/letter/a/f475e1/32.png) [@anjireddy543](https://discuss.elastic.co/u/anjireddy543)\
**Post date:** [February 25, 2019, 11:39am UTC](https://discuss.elastic.co/t/multi-match-field-highlight-if-all-words-match/168766/3 "2019-02-25T11:39:52Z")

</div>

Thanks for the replay, I have used **matched queries** for identifying the matched fields.

---

<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:** [March 25, 2019, 11:39am UTC](https://discuss.elastic.co/t/multi-match-field-highlight-if-all-words-match/168766/4 "2019-03-25T11:39:54Z")

</div>

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