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

版本: 6.8-8.9

简而言之,当 Elasticsearch 接收到不包含必需字段 “type” 和 “coordinates” 的形状查询时,会出现此错误。Elasticsearch 使用这些字段来识别和定位形状。要解决此问题,请确保您的形状查询同时包含 “type” 和 “coordinates” 字段。“type” 字段应指定形状类型(例如 “point”、“polygon”),“coordinates” 字段应提供形状的具体位置详细信息。

日志上下文 #


日志 “shape must be an object consisting of type and coordinates” 的类名是 GeometryParserFormat.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入上下文的人参考:

public static GeometryParserFormat geometryFormat(XContentParser parser) {
 return switch (parser.currentToken()) {
 // 我们不知道原始几何图形的格式 - 因此使用默认格式
 case START_OBJECT; VALUE_NULL -> GEOJSON;
 case VALUE_STRING -> WKT;
 default -> throw new ElasticsearchParseException("shape must be an object consisting of type and coordinates");
 };
 }
}