elasticsearch报错:exceeds the [index.highlight.max_analyzed_offset] limit [1000000]
  TEZNKK3IfmPf 2023年11月14日 18 0

elasticsearch报错: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 length [27277624] of field [content] in doc[2]/index[1234567890abcdefg] 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.


*************************************************************************************
Found index level settings on node level configuration.

Since elasticsearch 5.x index level settings can NOT be set on the nodes
configuration like the elasticsearch.yaml, in system properties or command line
arguments.In order to upgrade all indices the settings must be updated via the
//_settings API. Unless all settings are dynamic all indices must be closed
in order to apply the upgradeIndices created in the future should use index templates
to set default values.

Please ensure all required values are updated on all indices by executing:

curl -XPUT 'http://localhost:9200/_all/_settings?preserve_existing=true' -d '{
  "index.highlight.max_analyzed_offset" : "999999999"
}'

意思是说es从5.*开始,不能在elasticsearch .yaml里面设置index.highlight.max_analyzed_offset了,需要通过配置文件或者http的PUT命令设置进去index.highlight.max_analyzed_offset。

解决方案,用postman或者任意一个可以post http值和参数的工具,对目标主机上部署的es进行put命令配置:

http://localhost:9200/_all/_settings?preserve_existing=true

注意,不是get或者post,而是PUT。

PUT的body请求体需要加上,内容:

{
  "index.highlight.max_analyzed_offset" : "999999999"
}

es启动起来后,在执行http的put。

如果一切正常,es对于这个http的put返回确认结果:

{
"acknowledged": true
}

同时,在es的运行控制台会输出:

updating [index.highlight.max_analyzed_offset] from [1000000] to [999999999]

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月14日 0

暂无评论

推荐阅读
TEZNKK3IfmPf