Search on geoshape : indexedShapeType is required if indexedShapeId is specified

Based on the documentation mapping types are to be depecrated in APIs in Elasticsearch 7.0.0 and completely removed in 8.0.0. We are keeping our ES really up to date as such we are on 6.6 right now. Since types are to be remove, we have done it already.

Now we are adding geo functionnality, for this we have addresses indexed in on index and also shapes(polygon), in another index. We are using the geo shape indexed shape query, so that we can reference to these shape instead of providing coordinates within the request each time.

Thing is I am getting an error when I execute my get request JSON looks like :

GET /address_index/_search
{
    "query": {
        "bool": {
            "filter": [
                {
                    "geo_shape": {
                        "location": {
                            "relation": "intersects",
                            "indexed_shape": {
                                "index": "polygon_index",
                                //"type": "_doc",
                                "id": "shape.1",
                                "path": "geometry"
                            }
                        }
                    }
                }
            ]
        }
    }
}

{
    "error": {
        "root_cause": [
            {
                "type": "illegal_argument_exception",
                "reason": "indexedShapeType is required if indexedShapeId is specified"
            }
        ],
        "type": "illegal_argument_exception",
        "reason": "indexedShapeType is required if indexedShapeId is specified"
    },
    "status": 400
}

If I create polygon_index with a mapping type of _doc for example, then the request is working. To me this request then goes against specification...

If you are using version 6.6, you are required to provide a type. This will change in 7.0.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.