# Setting max\_analyzed\_offset permanently for an index

**URL:** <https://discuss.elastic.co/t/setting-max-analyzed-offset-permanently-for-an-index/334470>\
**Category:** Elasticsearch\
**Created:** [May 26, 2023, 7:55pm UTC](https://discuss.elastic.co/t/setting-max-analyzed-offset-permanently-for-an-index/334470 "2023-05-26T19:55:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zaeemmasood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaeemmasood/32/102383_2.png) [@zaeemmasood](https://discuss.elastic.co/u/zaeemmasood)\
**Post date:** [May 26, 2023, 7:55pm UTC](https://discuss.elastic.co/t/setting-max-analyzed-offset-permanently-for-an-index/334470/1 "2023-05-26T19:55:43Z")

</div>

Hi All,

We are using ELK stack 7.13.2

I came across an error while displaying an index in dashboard as follows:

```auto
The length [2134324] of field [additionalInfo] in doc[100496]/index[370844-2023.05.24] exceeds the [index.highlight.max_analyzed_offset] limit [1000000]. To avoid this error, set the query parameter [max_analyzed_offset] to a value less than index setting [1000000] and this will tolerate long field values by truncating them.

```

The field "additionalinfo" did have large number of characters.

I went ahead and bumped up the setting for the index as follows:

```auto
PUT /370844-2023*/_settings
{
  "index" : {
    "highlight.max_analyzed_offset" : 3000000
  }
}

```

Note that I used an asterisk so that the setting gets applied on all the indices.

This fixed the issue and indices started appearing without a problem. I understand that this is heavy on system resources.

Issue is that the new indices (they roll over date wise) being created do not seem to inherit the setting of 300000.

Please guide on how to make a permanent change to the index which would be applicable to all the indices getting created in future.

Thanks

---

<div class="post-metadata">

**Author:** ![zaeemmasood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zaeemmasood/32/102383_2.png) [@zaeemmasood](https://discuss.elastic.co/u/zaeemmasood)\
**Post date:** [May 28, 2023, 5:36pm UTC](https://discuss.elastic.co/t/setting-max-analyzed-offset-permanently-for-an-index/334470/2 "2023-05-28T17:36:22Z")

</div>

Created an index template which should take care of indices created in future.

```auto
PUT /_index_template/template_370844
{
  "index_patterns" : ["370844-2023*"],
  "priority" : 1,
  "template": {
    "settings" : {
      "highlight.max_analyzed_offset" : 3000000
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [May 29, 2023, 7:48am UTC](https://discuss.elastic.co/t/setting-max-analyzed-offset-permanently-for-an-index/334470/3 "2023-05-29T07:48:56Z")

</div>

Please note that version is [EOL](https://www.elastic.co/support/eol) and no longer supported, you should be looking to upgrade as a matter of urgency.

---

<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 26, 2023, 7:49am UTC](https://discuss.elastic.co/t/setting-max-analyzed-offset-permanently-for-an-index/334470/4 "2023-06-26T07:49:57Z")

</div>

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