12

When I do a query for to my index, I'm getting the following error:

"The length of [field_21] field of [82213] doc of [jobs] index has exceeded [10000] - maximum allowed to be analyzed for highlighting. 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!"

When I increase the max_analyzed_offset from 10,000 to 10,000,000, it solves my problem, and the queries are equally as fast. Should I be worried about leaving this setting like this? Would I hit a performance drop off? Or should I use offsets / term vectors? One caveat with using the term vectors, is that they increase the size of the index.

Also, is there a way to disable the highlighting if it contains more than a particular number of characters?

A. Nadjar
  • 2,440
  • 2
  • 19
  • 20
Jesse Wright
  • 121
  • 1
  • 1
  • 6
  • Did you permanently set the `max_analyzed_offset` value? If so, how? With new indices I have to manually invoke the following REST request to update the `max_analyzed_offset` value: `PUT /index_name_nere/_settings { "index" : { "highlight.max_analyzed_offset" : 10000000 } }` – m2web Sep 05 '19 at 14:45
  • 1
    Yes, I did set the `highlight.max_analyzed_offset` manually through the _settings endpoint. I'm curious if setting this to a higher number will cause performance issues. – Jesse Wright Sep 11 '19 at 13:51
  • Elasticsearch seemed to also offer another (and possibly better) option to combat these exceptions, without having to increase the index setting of highlight.max_analyzed_offset. Lets face it, if you can't find a highlight after a million chars, that's a pretty big doc. https://github.com/elastic/elasticsearch/pull/69016 – Patrick Scott Best Mar 03 '22 at 05:28

0 Answers0