# Highlighting only first occurence

**URL:** https://discuss.elastic.co/t/highlighting-only-first-occurence/85173
**Category:** Elasticsearch
**Created:** [May 10, 2017, 12:40am UTC](https://discuss.elastic.co/t/highlighting-only-first-occurence/85173 "2017-05-10T00:40:23Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Manvir\_Basra](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@Manvir\_Basra](https://discuss.elastic.co/u/Manvir_Basra)
#### Post date: [May 10, 2017, 12:40am UTC](https://discuss.elastic.co/t/highlighting-only-first-occurence/85173/1 "2017-05-10T00:40:23Z")

</div>

Hi,

Elastic search is not highlighting all the occurrences. Is there any configuration to achieve this result?

Data - Road 1, Road 2, Road 3  
Search by keyword: Road

Expected Result  
Highlight : _ **Road** _ 1, _ **Road** _ 2, _ **Road** _ 3

Actual Result  
Highlight: _ **Road** _ 1, Road 2, Road 3

Thanks!

---

<div class="post-metadata">

### Author: ![Manvir\_Basra](https://avatars.discourse-cdn.com/v4/letter/m/e95f7d/32.png) [@Manvir\_Basra](https://discuss.elastic.co/u/Manvir_Basra)
#### Post date: [May 10, 2017, 7:22pm UTC](https://discuss.elastic.co/t/highlighting-only-first-occurence/85173/2 "2017-05-10T19:22:18Z")

</div>

Fixed it using posting highlighter  
Added following line in mappings for specific field

"index\_options" : "offsets"

---

<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: [June 7, 2017, 7:22pm UTC](https://discuss.elastic.co/t/highlighting-only-first-occurence/85173/3 "2017-06-07T19:22:23Z")

</div>

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