版本: 7.2-8.9
简而言之,当 Elasticsearch 期望接收点列表(坐标)进行地理空间查询时,却只接收到单个点,就会出现此错误。这可能是由于格式不正确或数据输入错误导致的。要解决此问题,请确保您的数据输入与预期格式匹配。如果您使用的是 geo_shape 查询,请确保提供的是点数组。如果您使用的是 geo_point 查询,请确保提供的是单个点。此外,请检查您的映射以确保它与您查询的数据类型相匹配。
日志上下文 #
日志 “expected a list of points but got a point” 的类名是 GeoJson.java。我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入了解的人参考:
return coordinate;
}
public MultiPoint asMultiPoint() {
if (coordinate != null) {
throw new ElasticsearchException("expected a list of points but got a point");
}
List<Point> points = new ArrayList<>();
for (CoordinateNode node : children) {
points.add(node.asPoint());
}
}





