Reputation: 41
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.
Upvotes: 1
Views: 3682
Reputation: 4883
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.
Upvotes: 1