简体   繁体   中英

Overwrite/Update Existing Elasticsearch Index Mapping (geo_point) using Kibana

I am trying to update the mapping for a geo_point field in my elasticsearch index but am running into issues. I am using the dev tool console in Kibana.

The data for the geo_point is in a double array format . I am using spark with the elasticsearch-hadoop-5.3.1.jar and the data is coming into elasticsearch/kibana but remains as a number format while I need to convert it to a geo_point.

It seems that I am unable to update the index mapping once it is defined. I've tried using the method below:

PUT my_index
{
  "mappings": {
    "my_type": {
      "properties": {
        "my_location": {
          "type": "geo_point"
        }
      }
    }
  }
}

-but this results in an "index already exists exception" error.

Thanks for any suggestions.

The command you used just try to create new index with mappings mentioned. For more information read the foot notes in first example here .

As per Elasticsearch documentation, updating mappings of an existing field is not possible.

Updating Field Mappings

In general, the mapping for existing fields cannot be updated. There are some exceptions to this rule. For instance:

  • new properties can be added to Object datatype fields.
  • new multi-fields can be added to existing fields.
  • the ignore_above parameter can be updated.

As geo_point doesn't fall into any case mentioned above, you cannot modify mappings of that field.

You might need to reindex the data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM