--- title: "坐标未包含 - 如何解决此 Elasticsearch 异常" date: 2026-02-06 lastmod: 2026-02-06 description: "当 Elasticsearch 尝试索引或搜索地理空间数据时,缺少必需的坐标或坐标格式不正确导致的错误。确保索引数据包含必要的地理空间坐标并正确格式化可解决此问题。" tags: ["Elasticsearch", "地理空间数据", "坐标", "索引错误", "GeoJSON"] summary: " 版本: 6.8-8.9 简而言之,当 Elasticsearch 尝试索引或搜索地理空间数据时,如果缺少必需的坐标或坐标格式不正确,就会出现此错误。要解决此问题,请确保您尝试索引的数据包含必要的地理空间坐标,并且它们的格式正确。此外,请检查您的映射以确保为地理空间数据正确设置了映射。如果您正在使用管道,请验证它是否正确提取和格式化了坐标。 日志上下文 # 日志 “coordinates not included” 的类名是 GeoJson.java。我们从 Elasticsearch 源代码中提取了以下内容,以供寻求深入背景的人参考: return new GeometryCollection<>(geometries); } // We expect to have coordinates for all the rest if (coordinates == null) { throw new ElasticsearchParseException("coordinates not included"); } return switch (shapeType) { case CIRCLE -> { if (radius == null) { " --- > **版本:** 6.8-8.9 简而言之,当 Elasticsearch 尝试索引或搜索地理空间数据时,如果缺少必需的坐标或坐标格式不正确,就会出现此错误。要解决此问题,请确保您尝试索引的数据包含必要的地理空间坐标,并且它们的格式正确。此外,请检查您的映射以确保为地理空间数据正确设置了映射。如果您正在使用管道,请验证它是否正确提取和格式化了坐标。 ## 日志上下文 日志 “coordinates not included” 的类名是 [GeoJson.java](https://www.geeksforgeeks.org/java-lang-class-class-java-set-1/)。我们从 Elasticsearch 源代码中提取了以下内容,以供寻求深入背景的人参考: ```java return new GeometryCollection<>(geometries); } // We expect to have coordinates for all the rest if (coordinates == null) { throw new ElasticsearchParseException("coordinates not included"); } return switch (shapeType) { case CIRCLE -> { if (radius == null) { ```