I'm working with this setup
"version": {
"number": "7.2.0",
"build_flavor": "oss",
"build_type": "tar",
"build_hash": "508d38a",
"build_date": "2019-06-20T15:54:18.811730Z",
"build_snapshot": false,
"lucene_version": "8.0.0",
"minimum_wire_compatibility_version": "6.8.0",
"minimum_index_compatibility_version": "6.0.0-beta1"
},
I'm doing exactly as explained here.
PUT my_index
{
"mappings": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
I can confirm that the index is correctly created:
{
"my_index": {
"aliases": {},
"mappings": {
"properties": {
"location": {
"type": "geo_point"
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"auto_expand_replicas": null,
"provided_name": "my_index",
"creation_date": "1583495525728",
"priority": "0",
"number_of_replicas": "1",
"uuid": "KEtK4VDxSXsfseD5C0A1Q",
"version": {
"created": "7021099"
}
}
}
}
}
But when I perform a POST query to insert some coordinates:
POST /my_index/my_index
{
"text": "Geo-point as an object",
"location": {
"lat": 41.12,
"lon": -71.34
}
}
This is the answer:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "mapper [location] of different type, current_type [geo_point], merged_type [ObjectMapper]"
}
],
"type": "illegal_argument_exception",
"reason": "mapper [location] of different type, current_type [geo_point], merged_type [ObjectMapper]"
},
"status": 400
}
I don't understand what am I doing wrong. I also tried the other POST geo_point syntaxes with no luck.