GeoShape Query

edit

Query version of the geo_shape Filter.

Requires the geo_shape Mapping.

Given a document that looks like this:

{
    "name": "Wind & Wetter, Berlin, Germany",
    "location": {
        "type": "Point",
        "coordinates": [13.400544, 52.530286]
    }
}

The following query will find the point:

{
    "query": {
        "geo_shape": {
            "location": {
                "shape": {
                    "type": "envelope",
                    "coordinates": [[13, 53],[14, 52]]
                }
            }
        }
    }
}

See the Filter’s documentation for more information.

Relevancy and Score

edit

Currently Elasticsearch does not have any notion of geo shape relevancy, consequently the Query internally uses a constant_score Query which wraps a geo_shape filter.