# Highlight fields not matching multiple words

**URL:** <https://discuss.elastic.co/t/highlight-fields-not-matching-multiple-words/211383>\
**Category:** Elastic Search\
**Tags:** elastic-site-search\
**Created:** [December 10, 2019, 10:01pm UTC](https://discuss.elastic.co/t/highlight-fields-not-matching-multiple-words/211383 "2019-12-10T22:01:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dileep\_Ratnayake](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dileep_ratnayake/32/59159_2.png) [@Dileep\_Ratnayake](https://discuss.elastic.co/u/Dileep_Ratnayake)\
**Post date:** [December 10, 2019, 10:01pm UTC](https://discuss.elastic.co/t/highlight-fields-not-matching-multiple-words/211383/1 "2019-12-10T22:01:34Z")

</div>

I'm trying to get swiftype to highlight search results in a multiple keywords search.  
If a result body and/or title has atleast one of the keywords matched, they need to be highlighted.  
I also noticed that if a result has matching keywords, they are not highlighted either.  
It only highlights if the search is only one keyword which leads me to believe that multiple keyword highlights are ignored?

```
data: {
                engine_key : 'EngineKeyGoesHere',
                q: keyword,
                per_page: 10,
                page: pageNum,
                spelling: "strict",
                highlight_fields: {'page': {'title': {'size': maxStrLen, 'fallback': true },'body': {'size': maxStrLen, 'fallback': true }}},
            },

```

I have verified that there are matching keywords with in the maxStrLen limit.  
Any idea on what I can do get matching keywords (individual) to be highlighted in a multiple keyword search?

---

<div class="post-metadata">

**Author:** ![JasonStoltz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jasonstoltz/32/49893_2.png) [@JasonStoltz](https://discuss.elastic.co/u/JasonStoltz)\
**Post date:** [December 11, 2019, 10:32am UTC](https://discuss.elastic.co/t/highlight-fields-not-matching-multiple-words/211383/2 "2019-12-11T10:32:05Z")

</div>

Hey @Dileep_Ratnayake,

I was just poking around at a Site Search demo we have deployed: [https://search-ui-stable-site-search.netlify.com/?q=monocline%20exhibits%20diverse&size=n\_20\_n](https://search-ui-stable-site-search.netlify.com/?q=monocline%20exhibits%20diverse&size=n_20_n)

It appears to me that we do highlight all matching terms.

 ![screencapture-search-ui-stable-site-search-netlify-2019-12-11-05_22_37](https://us1.discourse-cdn.com/elastic/original/3X/b/5/b5f11003fb909ec9caf83711b829d225698e1400.png)

Hope this helps,

Jason

---

<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:** [January 8, 2020, 10:32am UTC](https://discuss.elastic.co/t/highlight-fields-not-matching-multiple-words/211383/3 "2020-01-08T10:32:05Z")

</div>

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