【问题标题】:elasticsearch index field of type geo_point won't allow PUT of WKT coordinatesgeo_point 类型的弹性搜索索引字段不允许 PUT 的 WKT 坐标
【发布时间】:2021-10-07 05:06:06
【问题描述】:

当通过 Kibana 控制台将 WKT 数据插入 geo_point 字段时,Elasticsearch(AWS 版本 7.1)给了我一条错误消息。尝试在

的简单索引上执行此操作时会发生这种情况
PUT my-geopoints
{
  "mappings": {
    "properties": {
      "location": {
        "type": "geo_point"
      }
    }
  }
}

来自网站https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html 或我自己的带有geo_point 字段的索引。

在 Kibana 控制台中运行时:

PUT my-geopoints/_doc/5
{
  "text": "Geopoint as a WKT POINT primitive",
  "location" : "POINT (-71.34 41.12)" 
}

我得到的错误信息是:

{
  "error":{
    "root_cause": [
      {
        "type": "parse_exception",
        "reason": "unsupported symbol [P] in geohash [POINT (-71.34 41.12)]"
      }
    ],
    "type": "mapper_parsing_exception",
    "reason": "failed to parse field [location] of type [geo_point]",
    "caused_by":{
      "type": "parse_exception",
      "reason": "unsupported symbol [P] in geohash [POINT (-71.34 41.12)]",
      "caused_by": {
        "type": "illegal_argument_exception",
        "reason": "unsupported symbol [P] in geohash [POINT (-71.34 41.12)]"
      }
    }
  },
  "status": 400
}

现在将我的数据批量加载到加载 WKT 几何数据的单独索引时会发生这种情况。我找不到任何指向任何原因的东西。昨天和今天早上它一直有效,直到我尝试了本教程以试图弄清楚为什么地理距离教程 (https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-query.html) 不允许我为 geo_shapes 使用与 geo_points 相同的索引映射。这本身就是一个单独的问题。

【问题讨论】:

    标签: elasticsearch geopoints


    【解决方案1】:

    我们从 Elasticsearch 7.1 升级到 7.10 并修复了这个特定问题。

    【讨论】:

    【解决方案2】:

    更改映射中的位置类型 "type": "geo_point""type": "geo_shape" 并尝试

    【讨论】:

      猜你喜欢
      • 2018-08-08
      • 1970-01-01
      • 2016-01-12
      • 1970-01-01
      • 2019-09-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-21
      相关资源
      最近更新 更多