2015-06-03 19:59:22 -04:00
|
|
|
[[geo-queries]]
|
|
|
|
== Geo queries
|
|
|
|
|
|
|
|
Elasticsearch supports two types of geo data:
|
2015-08-06 11:24:29 -04:00
|
|
|
<<geo-point,`geo_point`>> fields which support lat/lon pairs, and
|
|
|
|
<<geo-shape,`geo_shape`>> fields, which support points,
|
2018-10-05 10:08:03 -04:00
|
|
|
lines, circles, polygons, multi-polygons, etc.
|
2015-06-03 19:59:22 -04:00
|
|
|
|
|
|
|
The queries in this group are:
|
|
|
|
|
|
|
|
<<query-dsl-geo-bounding-box-query,`geo_bounding_box`>> query::
|
2019-07-18 10:18:11 -04:00
|
|
|
Finds documents with geo-points that fall into the specified rectangle.
|
2015-06-03 19:59:22 -04:00
|
|
|
|
|
|
|
<<query-dsl-geo-distance-query,`geo_distance`>> query::
|
2019-07-18 10:18:11 -04:00
|
|
|
Finds documents with geo-points within the specified distance of a central point.
|
2015-06-03 19:59:22 -04:00
|
|
|
|
|
|
|
<<query-dsl-geo-polygon-query,`geo_polygon`>> query::
|
2019-07-18 10:18:11 -04:00
|
|
|
Find documents with geo-points within the specified polygon.
|
2015-06-03 19:59:22 -04:00
|
|
|
|
2019-07-18 10:18:11 -04:00
|
|
|
<<query-dsl-geo-shape-query,`geo_shape`>> query::
|
2020-03-19 08:00:36 -04:00
|
|
|
Finds documents with:
|
|
|
|
* `geo-shapes` which either intersect, are contained by, or do not intersect
|
|
|
|
with the specified geo-shape
|
|
|
|
* `geo-points` which intersect the specified
|
|
|
|
geo-shape
|
2015-06-03 19:59:22 -04:00
|
|
|
|
|
|
|
include::geo-bounding-box-query.asciidoc[]
|
|
|
|
|
|
|
|
include::geo-distance-query.asciidoc[]
|
|
|
|
|
|
|
|
include::geo-polygon-query.asciidoc[]
|
2019-07-18 10:18:11 -04:00
|
|
|
|
|
|
|
include::geo-shape-query.asciidoc[]
|