# The length of text to be analyzed for highlighting \[18031\] exceeded the allowed maximum of \[10000\] set for the next major Elastic version. For large texts, indexing with offsets or term vectors is recommended!

**URL:** <https://discuss.elastic.co/t/the-length-of-text-to-be-analyzed-for-highlighting-18031-exceeded-the-allowed-maximum-of-10000-set-for-the-next-major-elastic-version-for-large-texts-indexing-with-offsets-or-term-vectors-is-recommended/128740>\
**Category:** Elasticsearch\
**Created:** [April 19, 2018, 3:56pm UTC](https://discuss.elastic.co/t/the-length-of-text-to-be-analyzed-for-highlighting-18031-exceeded-the-allowed-maximum-of-10000-set-for-the-next-major-elastic-version-for-large-texts-indexing-with-offsets-or-term-vectors-is-recommended/128740 "2018-04-19T15:56:42Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![vaishali1](https://avatars.discourse-cdn.com/v4/letter/v/f05b48/32.png) [@vaishali1](https://discuss.elastic.co/u/vaishali1)\
**Post date:** [April 19, 2018, 3:56pm UTC](https://discuss.elastic.co/t/the-length-of-text-to-be-analyzed-for-highlighting-18031-exceeded-the-allowed-maximum-of-10000-set-for-the-next-major-elastic-version-for-large-texts-indexing-with-offsets-or-term-vectors-is-recommended/128740/1 "2018-04-19T15:56:43Z")

</div>

[2018-04-17T15:00:25,855][WARN][d.o.a.l.s.u.CustomUnifiedHighlighter] The length of text to be analyzed for highlighting [18031] exceeded the allowed maximum of [10000] set for the next major Elastic version. For large texts, indexing with offsets or term vectors is recommended!  
Solution?  
**Error 2: Request Timeout in Kibana**

Can anyone help me to solve this issue?

---

<div class="post-metadata">

**Author:** ![PolterFox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polterfox/32/29781_2.png) [@PolterFox](https://discuss.elastic.co/u/PolterFox)\
**Post date:** [April 19, 2018, 4:00pm UTC](https://discuss.elastic.co/t/the-length-of-text-to-be-analyzed-for-highlighting-18031-exceeded-the-allowed-maximum-of-10000-set-for-the-next-major-elastic-version-for-large-texts-indexing-with-offsets-or-term-vectors-is-recommended/128740/2 "2018-04-19T16:00:01Z")

</div>

Change the setting index.highlight.max\_analyzed\_offset to your limit which is possible for you.

---

<div class="post-metadata">

**Author:** ![aswinikumari](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@aswinikumari](https://discuss.elastic.co/u/aswinikumari)\
**Post date:** [April 19, 2018, 6:07pm UTC](https://discuss.elastic.co/t/the-length-of-text-to-be-analyzed-for-highlighting-18031-exceeded-the-allowed-maximum-of-10000-set-for-the-next-major-elastic-version-for-large-texts-indexing-with-offsets-or-term-vectors-is-recommended/128740/3 "2018-04-19T18:07:45Z")

</div>

the following curl command is used to set the offset, however it failed

curl -XPUT [http://localhost:9200/\_settings](http://localhost:9200/_settings) -H "Content-Type: application/json" -d '{ "index.highlight.max\_analyzed\_offset": 100000 }'

Please correct me if this curl command is correct

---

<div class="post-metadata">

**Author:** ![aswinikumari](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@aswinikumari](https://discuss.elastic.co/u/aswinikumari)\
**Post date:** [April 19, 2018, 7:29pm UTC](https://discuss.elastic.co/t/the-length-of-text-to-be-analyzed-for-highlighting-18031-exceeded-the-allowed-maximum-of-10000-set-for-the-next-major-elastic-version-for-large-texts-indexing-with-offsets-or-term-vectors-is-recommended/128740/4 "2018-04-19T19:29:59Z")

</div>

This is the error message

{"error":{"root\_cause":[{"type":"json\_parse\_exception","reason":"Unexpected character (''' (code 39)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: o  
rg.elasticsearch.transport.netty4.ByteBufStreamInput@30fdf0f1; line: 1, column: 2]"}],"type":"json\_parse\_exception","reason":"Unexpected character (''' (code 39)): expected a valid value (number, Stri  
ng, array, object, 'true', 'false' or 'null')\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@30fdf0f1; line: 1, column: 2]"},"status":500}curl: (6) Could not resolve host: index.h  
ighlight.max\_analyzed\_offset  
curl: (6) Could not resolve host: 100000  
curl: (3) [globbing] unmatched close brace/bracket in column 1

---

<div class="post-metadata">

**Author:** ![PolterFox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polterfox/32/29781_2.png) [@PolterFox](https://discuss.elastic.co/u/PolterFox)\
**Post date:** [April 20, 2018, 6:23am UTC](https://discuss.elastic.co/t/the-length-of-text-to-be-analyzed-for-highlighting-18031-exceeded-the-allowed-maximum-of-10000-set-for-the-next-major-elastic-version-for-large-texts-indexing-with-offsets-or-term-vectors-is-recommended/128740/5 "2018-04-20T06:23:28Z")

</div>

Hey @aswinikumari,  
your curl command want´s to override the global settings, but you must configure it on a specific index, which requires an higher`index.highlight.max_analyzed_offset`

Here you find an example:

> **Curl-Command**
>
> ```
> curl -XPUT "localhost:9200/your_example_index/_settings" -H 'Content-Type: application/json' -d'
> {
> "index" : {
> "index.highlight.max_analyzed_offset" : 100000
> }
> }
> '
> 
> ```

At least that's how I would understand it.

You can read more about updating indice settings [here](https://www.elastic.co/guide/en/elasticsearch/reference/6.2/indices-update-settings.html)

Best regards,  
Robert

---

<div class="post-metadata">

**Author:** ![aswinikumari](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@aswinikumari](https://discuss.elastic.co/u/aswinikumari)\
**Post date:** [April 26, 2018, 3:23pm UTC](https://discuss.elastic.co/t/the-length-of-text-to-be-analyzed-for-highlighting-18031-exceeded-the-allowed-maximum-of-10000-set-for-the-next-major-elastic-version-for-large-texts-indexing-with-offsets-or-term-vectors-is-recommended/128740/6 "2018-04-26T15:23:00Z")

</div>

Hi Team,

I'm able to increase the index.highlight.max\_analyzed\_offset = 100000, however Elasticseach throws error again as below

_Caused by: java.lang.IllegalArgumentException: The length of text to be analyzed for highlighting [1126818] exceeded the_  
\_ allowed maximum of [100000]. This maximum can be set by changing the [index.highlight.max\_analyzed\_offset] index level\_  
_setting. For large texts, indexing with offsets or term vectors is recommended!_

So, is there a way to turn of the highlighter, or to change the default boundary character?

This is urgent

---

<div class="post-metadata">

**Author:** ![aswinikumari](https://avatars.discourse-cdn.com/v4/letter/a/f04885/32.png) [@aswinikumari](https://discuss.elastic.co/u/aswinikumari)\
**Post date:** [May 1, 2018, 3:36pm UTC](https://discuss.elastic.co/t/the-length-of-text-to-be-analyzed-for-highlighting-18031-exceeded-the-allowed-maximum-of-10000-set-for-the-next-major-elastic-version-for-large-texts-indexing-with-offsets-or-term-vectors-is-recommended/128740/7 "2018-05-01T15:36:52Z")

</div>

Hi Team,

Can someone help here on the previous issue I'm facing.

second question is , could you please advise, how to use term vectors

---

<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:** [May 29, 2018, 3:50pm UTC](https://discuss.elastic.co/t/the-length-of-text-to-be-analyzed-for-highlighting-18031-exceeded-the-allowed-maximum-of-10000-set-for-the-next-major-elastic-version-for-large-texts-indexing-with-offsets-or-term-vectors-is-recommended/128740/8 "2018-05-29T15:50:40Z")

</div>

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