When migrating documents from ES 6.5.3 to 6.8.1 we are facing the following issue with the geo_shape type. By querying an indexed document from ES 6.5.3 with the following query on ES 6.8.1
{
"size": 2000,
"query": {
"bool": {
"filter": [
{
"geo_shape": {
"stopovers_cloud": {
"shape": {
"type": "circle",
"radius": "14006.0m",
"coordinates": [
0.182766,
49.284982
]
},
"relation": "intersects"
},
"ignore_unmapped": false,
"boost": 1
}
},
{
"geo_shape": {
"stopovers_cloud": {
"shape": {
"type": "circle",
"radius": "14006.0m",
"coordinates": [
-1.542045,
48.977566
]
},
"relation": "intersects"
},
"ignore_unmapped": false,
"boost": 1
}
},
{
"range": {
"max_distance_as_the_crow_flies_in_meters": {
"from": 102051,
"to": null,
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
},
{
"range": {
"date": {
"from": null,
"to": "2019-09-01T12:00:00.000Z",
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
},
{
"range": {
"last_departure_date": {
"from": "2019-09-01T04:00:00.000Z",
"to": null,
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
},
],
"adjust_pure_negative": true,
"boost": 1
}
},
"sort": [
{
"date": {
"order": "asc"
}
}
]
}
It returns:
{
"took": 3,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 3,
"skipped": 0,
"failed": 2,
"failures": [
{
"shard": 0,
"index": "offers_future_dev",
"node": "uTW70IOqTdGGKE1n0-LPTA",
"reason": {
"type": "query_shard_exception",
"reason": "failed to create query: THE_QUERY_ABOVE",
"index_uuid": "rW6MdkgiSr6zhOXgQZnwRg",
"index": "offers_future_dev",
"caused_by": {
"type": "unsupported_operation_exception",
"reason": "CIRCLE geometry is not supported"
}
}
}
]
},
"hits": {
"total": 0,
"max_score": null,
"hits": []
}
}
By reading a past thread here in which the person faced the same problem I have tried to update the mapping with the suggestion by @Ignacio_Vera:
curl -X PUT \
http://localhost:19200/offers_future_dev/offer/_mapping \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"properties": {
"polyline": {
"type": "geo_shape",
"strategy" : "recursive"
},
"stopovers_cloud": {
"type": "geo_shape",
"strategy" : "recursive"
}
}
}'
but it results in the following error:
{
"error": {
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "mapper [stopovers_cloud] of different type, current_type [geo_shape], merged_type [geo_shape]"
}
],
"type": "illegal_argument_exception",
"reason": "mapper [stopovers_cloud] of different type, current_type [geo_shape], merged_type [geo_shape]"
},
"status": 400
}
The message is meaningless as it mentions "different type", which are actually the same: "current_type [geo_shape], merged_type [geo_shape]", i.e., geo_shape for both.
Given this situation we are now stuck on ES 6.5.3 as this breaking change between this version and 6.8 does not seem to be easy to solve. Any ideas are welcome.
Thanks in advance.
Ps.: For information supplementary details are on the comments as there is a 7K limit on the question body.