2424|=======================================================================
2525|Option |Description| Default
2626
27- |`tree` |deprecated[6.6, PrefixTrees no longer used] Name of the PrefixTree
28- implementation to be used: `geohash` for GeohashPrefixTree and `quadtree`
29- for QuadPrefixTree. Note: This parameter is only relevant for `term` and
30- `recursive` strategies.
31- | `quadtree`
32-
33- |`precision` |deprecated[6.6, PrefixTrees no longer used] This parameter may
34- be used instead of `tree_levels` to set an appropriate value for the
35- `tree_levels` parameter. The value specifies the desired precision and
36- Elasticsearch will calculate the best tree_levels value to honor this
37- precision. The value should be a number followed by an optional distance
38- unit. Valid distance units include: `in`, `inch`, `yd`, `yard`, `mi`,
39- `miles`, `km`, `kilometers`, `m`,`meters`, `cm`,`centimeters`, `mm`,
40- `millimeters`. Note: This parameter is only relevant for `term` and
41- `recursive` strategies.
42- | `50m`
43-
44- |`tree_levels` |deprecated[6.6, PrefixTrees no longer used] Maximum number
45- of layers to be used by the PrefixTree. This can be used to control the
46- precision of shape representations andtherefore how many terms are
47- indexed. Defaults to the default value of the chosen PrefixTree
48- implementation. Since this parameter requires a certain level of
49- understanding of the underlying implementation, users may use the
50- `precision` parameter instead. However, Elasticsearch only uses the
51- tree_levels parameter internally and this is what is returned via the
52- mapping API even if you use the precision parameter. Note: This parameter
53- is only relevant for `term` and `recursive` strategies.
54- | various
55-
56- |`strategy` |deprecated[6.6, PrefixTrees no longer used] The strategy
57- parameter defines the approach for how to represent shapes at indexing
58- and search time. It also influences the capabilities available so it
59- is recommended to let Elasticsearch set this parameter automatically.
60- There are two strategies available: `recursive`, and `term`.
61- Recursive and Term strategies are deprecated and will be removed in a
62- future version. While they are still available, the Term strategy
63- supports point types only (the `points_only` parameter will be
64- automatically set to true) while Recursive strategy supports all
65- shape types. (IMPORTANT: see <<prefix-trees, Prefix trees>> for more
66- detailed information about these strategies)
67- | `recursive`
68-
69- |`distance_error_pct` |deprecated[6.6, PrefixTrees no longer used] Used as a
70- hint to the PrefixTree about how precise it should be. Defaults to 0.025 (2.5%)
71- with 0.5 as the maximum supported value. PERFORMANCE NOTE: This value will
72- default to 0 if a `precision` or `tree_level` definition is explicitly defined.
73- This guarantees spatial precision at the level defined in the mapping. This can
74- lead to significant memory usage for high resolution shapes with low error
75- (e.g., large shapes at 1m with < 0.001 error). To improve indexing performance
76- (at the cost of query accuracy) explicitly define `tree_level` or `precision`
77- along with a reasonable `distance_error_pct`, noting that large shapes will have
78- greater false positives. Note: This parameter is only relevant for `term` and
79- `recursive` strategies.
80- | `0.025`
81-
8227|`orientation`
8328a|Optional. Vertex order for the shape's coordinates list.
8429
@@ -106,15 +51,6 @@ ring (hole) vertices in clockwise order.
10651Individual GeoJSON or WKT documents can override this parameter.
10752| `RIGHT`
10853
109- |`points_only` |deprecated[6.6, PrefixTrees no longer used] Setting this option to
110- `true` (defaults to `false`) configures the `geo_shape` field type for point
111- shapes only (NOTE: Multi-Points are not yet supported). This optimizes index and
112- search performance for the `geohash` and `quadtree` when it is known that only points
113- will be indexed. At present geo_shape queries can not be executed on `geo_point`
114- field types. This option bridges the gap by improving point performance on a
115- `geo_shape` field so that `geo_shape` queries are optimal on a point only field.
116- | `false`
117-
11854|`ignore_malformed` |If true, malformed GeoJSON or WKT shapes are ignored. If
11955false (default), malformed GeoJSON and WKT shapes throw an exception and reject the
12056entire document.
@@ -139,86 +75,8 @@ GeoShape types are indexed by decomposing the shape into a triangular mesh and
13975indexing each triangle as a 7 dimension point in a BKD tree. This provides
14076near perfect spatial resolution (down to 1e-7 decimal degree precision) since all
14177spatial relations are computed using an encoded vector representation of the
142- original shape instead of a raster-grid representation as used by the
143- <<prefix-trees>> indexing approach. Performance of the tessellator primarily
144- depends on the number of vertices that define the polygon/multi-polygon. While
145- this is the default indexing technique prefix trees can still be used by setting
146- the `tree` or `strategy` parameters according to the appropriate
147- <<geo-shape-mapping-options>>. Note that these parameters are now deprecated
148- and will be removed in a future version.
149-
150- *IMPORTANT NOTES*
151-
152- `CONTAINS` relation query - when using the new default vector indexing strategy, `geo_shape`
153- queries with `relation` defined as `contains` are supported for indices created with
154- ElasticSearch 7.5.0 or higher.
155-
156-
157- [[prefix-trees]]
158- [discrete]
159- ==== Prefix trees
160-
161- deprecated[6.6, PrefixTrees no longer used] To efficiently represent shapes in
162- an inverted index, Shapes are converted into a series of hashes representing
163- grid squares (commonly referred to as "rasters") using implementations of a
164- PrefixTree. The tree notion comes from the fact that the PrefixTree uses multiple
165- grid layers, each with an increasing level of precision to represent the Earth.
166- This can be thought of as increasing the level of detail of a map or image at higher
167- zoom levels. Since this approach causes precision issues with indexed shape, it has
168- been deprecated in favor of a vector indexing approach that indexes the shapes as a
169- triangular mesh (see <<geoshape-indexing-approach>>).
170-
171- Multiple PrefixTree implementations are provided:
172-
173- * GeohashPrefixTree - Uses
174- {wikipedia}/Geohash[geohashes] for grid squares.
175- Geohashes are base32 encoded strings of the bits of the latitude and
176- longitude interleaved. So the longer the hash, the more precise it is.
177- Each character added to the geohash represents another tree level and
178- adds 5 bits of precision to the geohash. A geohash represents a
179- rectangular area and has 32 sub rectangles. The maximum number of levels
180- in Elasticsearch is 24; the default is 9.
181- * QuadPrefixTree - Uses a
182- {wikipedia}/Quadtree[quadtree] for grid squares.
183- Similar to geohash, quad trees interleave the bits of the latitude and
184- longitude the resulting hash is a bit set. A tree level in a quad tree
185- represents 2 bits in this bit set, one for each coordinate. The maximum
186- number of levels for the quad trees in Elasticsearch is 29; the default is 21.
187-
188- [[spatial-strategy]]
189- [discrete]
190- ===== Spatial strategies
191- deprecated[6.6, PrefixTrees no longer used] The indexing implementation
192- selected relies on a SpatialStrategy for choosing how to decompose the shapes
193- (either as grid squares or a tessellated triangular mesh). Each strategy
194- answers the following:
195-
196- * What type of Shapes can be indexed?
197- * What types of Query Operations and Shapes can be used?
198- * Does it support more than one Shape per field?
199-
200- The following Strategy implementations (with corresponding capabilities)
201- are provided:
202-
203- [cols="<,<,<,<",options="header",]
204- |=======================================================================
205- |Strategy |Supported Shapes |Supported Queries |Multiple Shapes
206-
207- |`recursive` |<<input-structure, All>> |`INTERSECTS`, `DISJOINT`, `WITHIN`, `CONTAINS` |Yes
208- |`term` |<<geo-point-type, Points>> |`INTERSECTS` |Yes
209-
210- |=======================================================================
211-
212- [discrete]
213- ===== Accuracy
214-
215- `Recursive` and `Term` strategies do not provide 100% accuracy and depending on
216- how they are configured it may return some false positives for `INTERSECTS`,
217- `WITHIN` and `CONTAINS` queries, and some false negatives for `DISJOINT` queries.
218- To mitigate this, it is important to select an appropriate value for the tree_levels
219- parameter and to adjust expectations accordingly. For example, a point may be near
220- the border of a particular grid cell and may thus not match a query that only matches
221- the cell right next to it -- even though the shape is very close to the point.
78+ original shape. Performance of the tessellator primarily
79+ depends on the number of vertices that define the polygon/multi-polygon.
22280
22381[discrete]
22482===== Example
@@ -238,33 +96,6 @@ PUT /example
23896--------------------------------------------------
23997// TESTSETUP
24098
241- This mapping definition maps the location field to the geo_shape
242- type using the default vector implementation. It provides
243- approximately 1e-7 decimal degree precision.
244-
245- [discrete]
246- ===== Performance considerations with Prefix Trees
247-
248- deprecated[6.6, PrefixTrees no longer used] With prefix trees,
249- Elasticsearch uses the paths in the tree as terms in the inverted index
250- and in queries. The higher the level (and thus the precision), the more
251- terms are generated. Of course, calculating the terms, keeping them in
252- memory, and storing them on disk all have a price. Especially with higher
253- tree levels, indices can become extremely large even with a modest amount
254- of data. Additionally, the size of the features also matters. Big, complex
255- polygons can take up a lot of space at higher tree levels. Which setting
256- is right depends on the use case. Generally one trades off accuracy against
257- index size and query performance.
258-
259- The defaults in Elasticsearch for both implementations are a compromise
260- between index size and a reasonable level of precision of 50m at the
261- equator. This allows for indexing tens of millions of shapes without
262- overly bloating the resulting index too much relative to the input size.
263-
264- [NOTE]
265- Geo-shape queries on geo-shapes implemented with PrefixTrees will not be executed if
266- <<query-dsl-allow-expensive-queries, `search.allow_expensive_queries`>> is set to false.
267-
26899[[input-structure]]
269100[discrete]
270101==== Input Structure
@@ -292,8 +123,6 @@ points.
292123and a LineString).
293124|`N/A` |`BBOX` |`envelope` |A bounding rectangle, or envelope, specified by
294125specifying only the top left and bottom right points.
295- |`N/A` |`N/A` |`circle` |A circle specified by a center point and radius with
296- units, which default to `METERS`.
297126|=======================================================================
298127
299128[NOTE]
@@ -641,16 +470,10 @@ POST /example/_doc
641470[discrete]
642471===== Circle
643472
644- Elasticsearch supports a `circle` type, which consists of a center
645- point with a radius.
646-
647- IMPORTANT: You cannot index the `circle` type using the default
648- <<geoshape-indexing-approach,BKD tree indexing approach>>. Instead, use a
473+ Neither GeoJSON nor WKT supports a point-radius circle type. Instead, use a
649474<<ingest-circle-processor,circle ingest processor>> to approximate the circle as
650475a <<geo-polygon,`polygon`>>.
651476
652- *NOTE:* Neither GeoJSON or WKT support a point-radius circle type.
653-
654477[discrete]
655478==== Sorting and Retrieving index Shapes
656479
0 commit comments