Skip to content

Commit 24e7262

Browse files
Refine geo-point and geo-shape docs (#90913) (#91135)
* Refine geo-point and geo-shape docs While reviewing the docs for another issue, some deprecated references to prefix-trees were discovered, leading to interest in bringing the docs a little more up-to-date. * Update docs/reference/mapping/types/geo-point.asciidoc Co-authored-by: Abdon Pijpelink <[email protected]> * Update docs/reference/mapping/types/geo-shape.asciidoc Co-authored-by: Abdon Pijpelink <[email protected]> Co-authored-by: Abdon Pijpelink <[email protected]> (cherry picked from commit c19f642) Co-authored-by: Craig Taverner <[email protected]>
1 parent ebad5d3 commit 24e7262

File tree

3 files changed

+30
-18
lines changed

3 files changed

+30
-18
lines changed

docs/reference/mapping/types/geo-point.asciidoc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ Fields of type `geo_point` accept latitude-longitude pairs, which can be used:
88

99
* to find geopoints within a <<query-dsl-geo-bounding-box-query,bounding box>>,
1010
within a certain <<query-dsl-geo-distance-query,distance>> of a central point,
11-
or within a <<query-dsl-geo-polygon-query,polygon>> or within a <<query-dsl-geo-shape-query,`geo_shape` query>>.
12-
* to aggregate documents <<search-aggregations-bucket-geohashgrid-aggregation,geographically>>
13-
or by <<search-aggregations-bucket-geodistance-aggregation,distance>> from a central point.
11+
or within a <<query-dsl-geo-shape-query,`geo_shape` query>> (for example, points in a polygon).
12+
* to aggregate documents by <<search-aggregations-bucket-geodistance-aggregation,distance>> from a central point
13+
* to aggregate documents by geographic grids: either
14+
<<search-aggregations-bucket-geohashgrid-aggregation,`geo_hash`>>,
15+
<<search-aggregations-bucket-geotilegrid-aggregation,`geo_tile`>> or
16+
<<search-aggregations-bucket-geohexgrid-aggregation,`geo_hex`>>.
1417
* to integrate distance into a document's <<query-dsl-function-score-query,relevance score>>.
1518
* to <<geo-sorting,sort>> documents by distance.
1619

docs/reference/mapping/types/geo-shape.asciidoc

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,28 @@
55
++++
66

77
The `geo_shape` data type facilitates the indexing of and searching
8-
with arbitrary geoshapes such as rectangles and polygons. It should be
9-
used when either the data being indexed or the queries being executed
10-
contain shapes other than just points.
8+
with arbitrary geoshapes such as rectangles, lines and polygons. If the data being
9+
indexed contains shapes other than just points, it is necessary to use this mapping.
10+
If the data contains only points, it can be indexed as either
11+
<<geo-point,`geo_point`>> or `geo_shape`.
1112

12-
You can query documents using this type using
13-
a <<query-dsl-geo-shape-query,`geo_shape` query>>.
13+
Documents using this type can be used:
14+
15+
* to find geoshapes within:
16+
** a <<query-dsl-geo-bounding-box-query,bounding box>>
17+
** a certain <<query-dsl-geo-distance-query,distance>> of a central point
18+
** a <<query-dsl-geo-shape-query,`geo_shape` query>> (for example, intersecting polygons).
19+
* to aggregate documents by geographic grids:
20+
** either <<search-aggregations-bucket-geohashgrid-aggregation,`geo_hash`>>
21+
** or <<search-aggregations-bucket-geotilegrid-aggregation,`geo_tile`>>.
22+
23+
Grid aggregations over `geo_hex` grids are not supported for `geo_shape` fields.
1424

1525
[[geo-shape-mapping-options]]
1626
[discrete]
1727
==== Mapping Options
1828

19-
The `geo_shape` mapping maps GeoJSON geometry objects to the `geo_shape`
29+
The `geo_shape` mapping maps GeoJSON or WKT geometry objects to the `geo_shape`
2030
type. To enable it, users must explicitly map fields to the `geo_shape`
2131
type.
2232

@@ -258,7 +268,7 @@ POST /example/_doc
258268

259269
A polygon's orientation indicates the order of its vertices: `RIGHT`
260270
(counterclockwise) or `LEFT` (clockwise). {es} uses a polygon’s orientation to
261-
determine if it crosses the international dateline (+/-180° longitude).
271+
determine if it crosses the international dateline (+/-180° longitude).
262272

263273
You can set a default orientation for WKT polygons using the
264274
<<geo-shape-mapping-options,`orientation` mapping parameter>>. This is because

docs/reference/query-dsl/geo-shape-query.asciidoc

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@
44
<titleabbrev>Geoshape</titleabbrev>
55
++++
66

7-
Filter documents indexed using the `geo_shape` or `geo_point` type.
7+
Filter documents indexed using either the <<geo-shape,`geo_shape`>> or the
8+
<<geo-point,`geo_point`>> type.
89

9-
Requires the <<geo-shape,`geo_shape` mapping>> or the
10-
<<geo-point,`geo_point` mapping>>.
11-
12-
The `geo_shape` query uses the same grid square representation as the
13-
`geo_shape` mapping to find documents that have a shape that is related
14-
to the query shape, using a specified spatial relationship: either intersects,
10+
The `geo_shape` query uses the same <<geoshape-indexing-approach, index>> as
11+
the `geo_shape` or `geo_point` mapping to find documents that have a shape that
12+
is related to the query shape, using a specified
13+
<<geo-shape-spatial-relations, spatial relationship>>: either intersects,
1514
contained, within or disjoint.
16-
It will also use the same Prefix Tree configuration as defined for the field mapping.
1715

1816
The query supports two ways of defining the query shape, either by
1917
providing a whole shape definition, or by referencing the name of a shape
@@ -229,6 +227,7 @@ GET /example/_search
229227
--------------------------------------------------
230228

231229

230+
[[geo-shape-spatial-relations]]
232231
==== Spatial relations
233232

234233
The following is a complete list of spatial relation operators available when

0 commit comments

Comments
 (0)