📣 极限科技诚招搜索运维工程师(Elasticsearch/Easysearch)- 全职/北京 👉 : 立即申请加入

版本: 6.8-7.9

简而言之,当 Elasticsearch 中的"positions_increment_gap"参数被设置为负值时,会发生此错误。该参数用于控制字段的每个实例之间应插入的虚假词条位置数量。它必须是一个正数。要解决此问题,你应该检查 Elasticsearch 设置或映射配置,并确保"positions_increment_gap"参数设置为正值。如果不是,请将其更改为正数并重新启动 Elasticsearch。

日志上下文 #

日志"[positions_increment_gap] must be positive; got"的类名是 AnnotatedTextFieldMapper.java。我们从 Elasticsearch 源代码中提取了以下内容,以便为那些寻求深入了解上下文的人提供参考:

builder = this;
 }  public Builder positionIncrementGap(int positionIncrementGap) {
 if (positionIncrementGap < 0) {
 throw new MapperParsingException("[positions_increment_gap] must be positive; got " + positionIncrementGap);
 }
 this.positionIncrementGap = positionIncrementGap;
 return this;
 }