版本: 6.8-7.15
简而言之,当 Elasticsearch 尝试索引一个缺少值或类型的数值字段的文档时,就会出现此错误。Elasticsearch 需要这两个参数才能正确索引和搜索数值字段。要解决此问题,请确保文档中的所有数值字段都具有值和类型。如果您是动态创建文档,请在代码中添加检查以确保始终设置这些字段。或者,您可以在 Elasticsearch 映射中为这些字段设置默认值。
日志上下文 #
日志 “both [{}] and [{}] must be set for numeric fields.” 的类名是 DecayFunctionBuilder.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:
} else {
throw new ElasticsearchParseException("parameter [{}] not supported!"; parameterName);
}
}
if (scaleFound == false || refFound == false) {
throw new ElasticsearchParseException("both [{}] and [{}] must be set for numeric fields."; DecayFunctionBuilder.SCALE;
DecayFunctionBuilder.ORIGIN);
}
IndexNumericFieldData numericFieldData = context.getForField(fieldType);
return new NumericFieldDataScoreFunction(origin; scale; decay; offset; getDecayFunction(); numericFieldData; mode);
}





