Skip to content

Commit d4ed43c

Browse files
authored
[DOCS] Remove deprecated geo_shape parameters (#74519)
* Removes docs and references for the following `geo_shape` mapping parameters: * `tree` * `tree_levels` * `strategy` * `distance_error_pct` * Updates a related breaking change. Relates to #70850
1 parent 73397f7 commit d4ed43c

File tree

5 files changed

+16
-203
lines changed

5 files changed

+16
-203
lines changed

docs/reference/ingest/processors/enrich.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ See <<ingest-enriching-data,enrich data>> section for more information about how
2020
| `ignore_missing` | no | false | If `true` and `field` does not exist, the processor quietly exits without modifying the document
2121
| `override` | no | true | If processor will update fields with pre-existing non-null-valued field. When set to `false`, such fields will not be touched.
2222
| `max_matches` | no | 1 | The maximum number of matched documents to include under the configured target field. The `target_field` will be turned into a json array if `max_matches` is higher than 1, otherwise `target_field` will become a json object. In order to avoid documents getting too large, the maximum allowed value is 128.
23-
| `shape_relation` | no | `INTERSECTS` | A spatial relation operator used to match the <<geo-shape,geo_shape>> of incoming documents to documents in the enrich index. This option is only used for `geo_match` enrich policy types. The <<spatial-strategy, geo_shape strategy>> mapping parameter determines which spatial relation operators are available. See <<_spatial_relations>> for operators and more information.
23+
| `shape_relation` | no | `INTERSECTS` | A spatial relation operator used to match the <<geo-shape,geo_shape>> of incoming documents to documents in the enrich index. This option is only used for `geo_match` enrich policy types. See <<_spatial_relations>> for operators and more information.
2424

2525
include::common-options.asciidoc[]
2626
|======

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

Lines changed: 3 additions & 180 deletions
Original file line numberDiff line numberDiff line change
@@ -24,61 +24,6 @@ type.
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`
8328
a|Optional. Vertex order for the shape's coordinates list.
8429

@@ -106,15 +51,6 @@ ring (hole) vertices in clockwise order.
10651
Individual 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
11955
false (default), malformed GeoJSON and WKT shapes throw an exception and reject the
12056
entire document.
@@ -139,86 +75,8 @@ GeoShape types are indexed by decomposing the shape into a triangular mesh and
13975
indexing each triangle as a 7 dimension point in a BKD tree. This provides
14076
near perfect spatial resolution (down to 1e-7 decimal degree precision) since all
14177
spatial 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.
292123
and a LineString).
293124
|`N/A` |`BBOX` |`envelope` |A bounding rectangle, or envelope, specified by
294125
specifying 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
650475
a <<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

docs/reference/migration/migrate_8_0/mappings.asciidoc

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,22 +94,23 @@ mappings with java-time formats.
9494
For a detailed migration guide, see the {ref}/migrate-to-java-time.html[Java
9595
time migration guide].
9696
====
97-
// end::notable-breaking-changes[]
9897

9998
[[geo-shape-strategy]]
100-
.The `strategy` parameter on `geo_shape` mappings now rejects unknown strategies.
99+
.Several `geo_shape` mapping parameters have been removed.
101100
[%collapsible]
102101
====
103102
*Details* +
104-
The only permissible values for the `strategy` parameter on `geo_shape` mappings
105-
are `term` and `recursive`. In 7.x if a non-permissible value was used as a
106-
parameter here, the mapping would silently fall back to using `recursive`. The
107-
mapping will now be rejected instead.
103+
The following `geo_shape` mapping parameters were deprecated in 6.6:
104+
105+
* `tree`
106+
* `tree_levels`
107+
* `strategy`
108+
* `distance_error_pct`
109+
110+
These parameters have been removed in 8.0.0.
108111
109112
*Impact* +
110-
This will have no impact on existing mappings created with non-permissible
111-
strategy values, as they will already be serializing themselves as if they
112-
had been configured as `recursive`. New indexes will need to use one of the
113-
permissible strategies, or preferably not define a strategy at all and use
114-
the far more efficient BKD index.
113+
In 8.0, you can no longer create mappings that include these parameters.
114+
However, 7.x indices that use these mapping parameters will continue to work.
115115
====
116+
// end::notable-breaking-changes[]

docs/reference/query-dsl.asciidoc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ the stability of the cluster. Those queries can be categorised as follows:
4949

5050
* <<joining-queries,Joining queries>>
5151

52-
* Queries on <<prefix-trees,deprecated geo-shapes>>
53-
5452
* Queries that may have a high per-document cost:
5553
** <<query-dsl-script-score-query,`script_score` queries>>
5654
** <<query-dsl-percolate-query,`percolate` queries>>

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

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,6 @@ GET /example/_search
230230

231231
==== Spatial Relations
232232

233-
The <<spatial-strategy, geo_shape strategy>> mapping parameter determines which
234-
spatial relation operators may be used at search time.
235-
236233
The following is a complete list of spatial relation operators available when
237234
searching a geo field:
238235

@@ -257,12 +254,6 @@ is not mapped.
257254
[[geo-shape-query-notes]]
258255
==== Notes
259256

260-
* Geo-shape queries on geo-shapes implemented with
261-
<<prefix-trees, `PrefixTrees`>> will not be executed if
262-
<<query-dsl-allow-expensive-queries, `search.allow_expensive_queries`>> is set
263-
to false.
264-
265-
266257
* When data is indexed in a `geo_shape` field as an array of shapes, the arrays
267258
are treated as one shape. For this reason, the following requests are
268259
equivalent.

0 commit comments

Comments
 (0)