As the guide stated, https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-geo-point-type.html#_mapping_options
I could use an array of lat/lon variables, and map it to geo_point type.
so here is my current mapping:
{
"zoek": {
"mappings": {
"geo": {
"properties": {
"country": {
"type": "string"
},
"geonameid": {
"type": "string"
},
"locatie": {
"type": "double"
},
"name": {
"type": "string"
}
}
}
}
}
}
"locatie" refers to an array of two double. [ lat, lon ].
I want to map this to the geo_point variable to perform geo distance queries.
so i tried this:
PUT /zoek/geo/_mapping
{
"geo" : {
"properties" : {
"locatie" : {"type" : "geo_point" }
}
}
}
and got this error:
{
"error": "MergeMappingException[Merge failed with failures {[mapper [locatie] of different type, current_type [double], merged_type [geo_point]]}]",
"status": 400 }
Any suggestions?
Greets,
Dagmar.