# Highlight. Different tags for different words in one highlight request. For one field

**URL:** https://discuss.elastic.co/t/highlight-different-tags-for-different-words-in-one-highlight-request-for-one-field/266388
**Category:** Elasticsearch
**Created:** [March 5, 2021, 3:43pm UTC](https://discuss.elastic.co/t/highlight-different-tags-for-different-words-in-one-highlight-request-for-one-field/266388 "2021-03-05T15:43:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![boralex](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boralex/32/85058_2.png) [@boralex](https://discuss.elastic.co/u/boralex)
#### Post date: [March 5, 2021, 3:43pm UTC](https://discuss.elastic.co/t/highlight-different-tags-for-different-words-in-one-highlight-request-for-one-field/266388/1 "2021-03-05T15:43:59Z")

</div>

Good day  
I have a question:  
Can I use several different tags for different words in one highlight request? Is it possible?  
For example (Let I have one text field):  
I have a request with phrases that should definitely be in the answer and definitely shouldn't be. I can highlight the phrases that should definitely be. But can I immediately highlight the phrases that should not have been included? For example, due to the large number of relevant phrases, the answer has one irrelevant phrases.

I would like to include all relevant phrases in these tags:

```auto
"pre_tags": ["<positive_word>"],
"post_tags": ["</positive_word>"]

```

I would like to include all irrelevant phrases in these tags:

```auto
"pre_tags": ["<negative_word>"],
"post_tags": ["</negative_word>"]

```

Best regards, Borus A.

---

<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 2, 2021, 3:44pm UTC](https://discuss.elastic.co/t/highlight-different-tags-for-different-words-in-one-highlight-request-for-one-field/266388/2 "2021-04-02T15:44:21Z")

</div>

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