olivere / elastic

Deprecated: Use the official Elasticsearch client for Go at https://github.com/elastic/go-elasticsearch
https://olivere.github.io/elastic/
MIT License
7.39k stars 1.15k forks source link

No max_analyzed_offset for highlighting in v7.0.30 #1591

Closed ikey4u closed 2 years ago

ikey4u commented 2 years ago

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 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.

olivere commented 2 years ago

Yep, looks like this is missing.