首页 > 解决方案 > 映射文件中的 ElasticSearch 纬度和经度 geo_type

问题描述

是否需要明确命名字段latlon进行geo_type映射才能工作?例如,这是我的代码:

public class coordinates {
    private String latitiude;
    private String longitude;
}

弹性搜索中的示例映射文件:

"coordinates": {
    "type": "geo_point"
}

我得到错误:

error': {'type': 'mapper_parsing_exception', 'reason': 'failed to parse field [coordinates] of type [geo_point]', 'caused_by': {'type': 'parse_exception', 'reason': 'field must be either [lat], [lon] or [geohash]'}}

还有其他方法吗?

标签: elasticsearch

解决方案


推荐阅读