# Add index\_options option to all text fields with dynamic templates

**URL:** https://discuss.elastic.co/t/add-index-options-option-to-all-text-fields-with-dynamic-templates/317303
**Category:** Elasticsearch
**Created:** [October 24, 2022, 9:21am UTC](https://discuss.elastic.co/t/add-index-options-option-to-all-text-fields-with-dynamic-templates/317303 "2022-10-24T09:21:55Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![frank\_esg](https://avatars.discourse-cdn.com/v4/letter/f/b19c9b/32.png) [@frank\_esg](https://discuss.elastic.co/u/frank_esg)
#### Post date: [October 24, 2022, 9:21am UTC](https://discuss.elastic.co/t/add-index-options-option-to-all-text-fields-with-dynamic-templates/317303/1 "2022-10-24T09:21:55Z")

</div>

Hello,

we´re using component templates to define field mappings based on ECS for all of our indices. In the past we had some issues with search highlighting in Kibana , when text fields are very big.

Now i would like to add "index\_options=offsets" to all text fields, so that search highlighting should no problem any longer.  
Is this possible with some dynamic mapping? I did some tests but i could not figure out how to assign a mapping option based on field type.

regards,  
Frank

---

<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: [November 21, 2022, 9:22am UTC](https://discuss.elastic.co/t/add-index-options-option-to-all-text-fields-with-dynamic-templates/317303/2 "2022-11-21T09:22:04Z")

</div>

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