Home > Net >  elasticsearch index field of type geo_point won't allow PUT of WKT coordinates
elasticsearch index field of type geo_point won't allow PUT of WKT coordinates

Time:10-07

Elasticsearch (AWS version 7.1) gives me an error message when inserting WKT data into the geo_point field via Kibana Console. This happens when trying to do it on simple index of

PUT my-geopoints
{
  "mappings": {
    "properties": {
      "location": {
        "type": "geo_point"
      }
    }
  }
}

from the website https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html or my own index with a field of geo_point.

When running in the Kibana Console:

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

The error message I am getting is:

{
  "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
}

This is now happening on a bulk load of my data to a separate index that loads WKT geometry data. I can't find anything that points to any reason why. Yesterday and this morning it worked until I tried this tutorial to try to figure out why the tutorial for geo distances (https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-distance-query.html) wasn't allowing me to have the same index mapping for geo_shapes as for geo_points. That will be a separate question itself.

CodePudding user response:

Change the location type in mappings "type": "geo_point" to "type": "geo_shape" and try

CodePudding user response:

We upgraded from Elasticsearch 7.1 to 7.10 and it fixed this particular issue.

  • Related