版本: 8.8-8.9
简而言之,当您尝试向Elasticsearch中未配置为接受多个值的字段插入多个值时,会出现此错误。要解决此问题,您可以修改要插入的数据,使其仅包含该字段的一个值,或者在Elasticsearch中重新配置该字段以接受多个值。这可以通过将字段类型设置为’nested’或’array’来实现,具体取决于您处理的数据性质。
日志上下文 #
日志"field type for [{}] does not accept more than single value"的类名是 AbstractPointGeometryFieldMapper.java。 我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人使用:
consumer.accept(validate(point));
} else {
int count = 0;
while (token != XContentParser.Token.END_ARRAY) {
if (allowMultipleValues == false && ++count > 1) {
throw new ElasticsearchParseException("field type for [{}] does not accept more than single value"; field);
}
if (parser.currentToken() == XContentParser.Token.VALUE_NULL) {
if (nullValue != null) {
consumer.accept(nullValue);
}





