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

版本: 8.3-8.9

简而言之,当 Elasticsearch 遇到 geo_point 字段的类型不是 ‘Point’ 时会发生此错误。Geo_point 字段用于索引地理位置,只接受 ‘Point’ 作为有效类型。要解决此问题,请确保您为 geo_point 字段索引的数据类型是 ‘Point’。如果您使用的是不同的类型,请在索引之前将其转换为 ‘Point’。此外,请检查您的映射以确保该字段正确定义为 geo_point。

日志上下文 #

日志"[type] for {} can only be ‘Point’“的类名是 GenericPointParser.java. 我们从 Elasticsearch 源代码中提取了以下内容,供那些寻求深入背景的人参考:

if (geohash != null) {
 return fromGeohash.apply(geohash);
 }
 if (coordinates != null) {
 if (geojsonType == null || geojsonType.toLowerCase(Locale.ROOT).equals("point") == false) {
 throw new ElasticsearchParseException("[type] for {} can only be 'Point'"; mapType);
 }
 if (coordinates.size() < 2) {
 throw new ElasticsearchParseException("[coordinates] must contain at least two values");
 }
 if (coordinates.size() == 3) {