When doing elastic query, if a filed length more than index.highlight.max_analyzed_offset, it will fail with the following error
illegal_argument_exception: The length [2692528] of field [content] in xxx exceeds the [index.highlight.max_analyzed_offset] limit [1000000]. To avoid this error, set the query parameter [max_analyzed_offset] to a value ....
To solve this problem, we can add a max_analyzed_offset to highlight field.
Please describe the actual behavior
API in highlight.go file does not provide any option to set max_analyzed_offset.
Which version of Elastic are you using?
elastic.v7 (for Elasticsearch 7.14.2)
Please describe the expected behavior
When doing elastic query, if a filed length more than
index.highlight.max_analyzed_offset
, it will fail with the following errorTo solve this problem, we can add a
max_analyzed_offset
to highlight field.Please describe the actual behavior
API in
highlight.go
file does not provide any option to setmax_analyzed_offset
.