版本: 8.2-8.2
简而言之,当您尝试在Elasticsearch中索引包含geo_point字段的文档时,如果GeoJSON对象的’type’不是’Point',就会出现此错误。Elasticsearch的geo_point字段只支持’Point’类型。要解决此问题,请确保GeoJSON对象的’type’为’Point'。如果您使用的是’Polygon’或’LineString’等其他类型,请考虑使用geo_shape数据类型。此外,请检查您的数据源,确保其提供正确的GeoJSON格式。
日志上下文 #
日志"GeoJSON ‘type’ for geo_point can only be ‘Point’“的类名是 GeoUtils.java。 我们从Elasticsearch源代码中提取了以下内容,供那些寻求深入上下文的人参考:
if (geohash != null) {
return point.parseGeoHash(geohash; effectivePoint);
}
if (coordinates != null) {
if (geojsonType == null || geojsonType.toLowerCase(Locale.ROOT).equals("point") == false) {
throw new ElasticsearchParseException("GeoJSON 'type' for geo_point can only be 'Point'");
}
if (coordinates.size() < 2) {
throw new ElasticsearchParseException("GeoJSON 'coordinates' must contain at least two values");
}
if (coordinates.size() == 3) {





