--- title: "几何体未包含 - 如何解决此 Elasticsearch 异常" date: 2026-03-20 lastmod: 2026-03-20 description: "Elasticsearch 在处理 geo_shape 查询时出现 'geometries not included' 异常的原因及解决方案" tags: ["Elasticsearch", "异常处理", "geo_shape", "地理空间查询", "GeoJSON"] summary: " 版本: 6.8-8.9 简而言之,当 Elasticsearch 尝试处理 geo_shape 查询时,如果所需的几何体数据缺失或格式不正确,就会出现此错误。要解决此问题,应确保在查询中以正确格式包含几何体数据。还可以检查映射,确保字段正确设置为 geo_shape 类型。如果错误仍然存在,考虑重新索引数据,以确保包含所有必要字段且格式正确。 日志上下文 # 日志 “geometries not included” 的类名是 GeoJson.java。 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入背景的人参考: } else { shapeType = ShapeType.forName(type); } if (shapeType == ShapeType.GEOMETRYCOLLECTION) { if (geometries == null) { throw new ElasticsearchParseException("geometries not included"); } if (coordinates != null) { throw new ElasticsearchParseException("parameter coordinates is not supported for type " + type); } verifyNulls(type; null; orientation; radius); " --- > **版本:** 6.8-8.9 简而言之,当 Elasticsearch 尝试处理 geo_shape 查询时,如果所需的几何体数据缺失或格式不正确,就会出现此错误。要解决此问题,应确保在查询中以正确格式包含几何体数据。还可以检查映射,确保字段正确设置为 geo_shape 类型。如果错误仍然存在,考虑重新索引数据,以确保包含所有必要字段且格式正确。 日志上下文 ----------- 日志 "geometries not included" 的类名是 [GeoJson.java。](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/) 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入背景的人参考: ```java } else { shapeType = ShapeType.forName(type); } if (shapeType == ShapeType.GEOMETRYCOLLECTION) { if (geometries == null) { throw new ElasticsearchParseException("geometries not included"); } if (coordinates != null) { throw new ElasticsearchParseException("parameter coordinates is not supported for type " + type); } verifyNulls(type; null; orientation; radius); ```