版本: 6.8-8.9
简而言之,当您尝试在 Elasticsearch 中使用不支持特定操作的字段时,会出现此错误。例如,您可能尝试在数值操作中使用文本字段。要解决此问题,首先应该检查映射中的字段类型。如果字段类型不正确,则需要将其更改为正确的类型。如果字段类型正确,则应该检查您尝试执行的操作,并确保它与字段类型兼容。
日志上下文 #
日志 “field [{}] is supported for [{}] only” 的类名是 GeoJsonParser.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入背景的人参考:
} else if (coordinateNode == null && GeoShapeType.GEOMETRYCOLLECTION != shapeType) {
throw new ElasticsearchParseException("coordinates not included");
} else if (geometryCollections == null && GeoShapeType.GEOMETRYCOLLECTION == shapeType) {
throw new ElasticsearchParseException("geometries not included");
} else if (radius != null && GeoShapeType.CIRCLE != shapeType) {
throw new ElasticsearchParseException("field [{}] is supported for [{}] only"; CircleBuilder.FIELD_RADIUS; CircleBuilder.TYPE);
} if (shapeType.equals(GeoShapeType.GEOMETRYCOLLECTION)) {
return geometryCollections;
}





