WARNING: Version 1.7 of Elasticsearch has passed its EOL date.
This documentation is no longer being maintained and may be removed. If you are running this version, we strongly advise you to upgrade. For the latest information, see the current release documentation.
GeoShape Query
editGeoShape Query
editQuery 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
editCurrently 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.
Spatial Relations
editThe geo_shape strategy mapping parameter determines which spatial relation operators may be used at search time.
The following is a complete list of spatial relation operators available:
-
INTERSECTS
- (default) Return all documents whosegeo_shape
field intersects the query geometry. -
DISJOINT
- Return all documents whosegeo_shape
field has nothing in common with the query geometry. -
WITHIN
- Return all documents whosegeo_shape
field is within the query geometry.