From 5b34bec92a6c6f575e01e92c282a56b253d201a5 Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Tue, 23 Aug 2016 13:43:35 -0400 Subject: [PATCH] Add deprecation warnings to docs for geohash Relates to #20126 --- .../mapping/params/geohash-precision.asciidoc | 16 ++++++++++++++-- .../mapping/params/geohash-prefix.asciidoc | 11 ++++++++++- docs/reference/mapping/params/geohash.asciidoc | 16 ++++++++++++---- docs/reference/mapping/params/lat-lon.asciidoc | 9 ++++++++- .../query-dsl/geohash-cell-query.asciidoc | 5 ++++- 5 files changed, 48 insertions(+), 9 deletions(-) diff --git a/docs/reference/mapping/params/geohash-precision.asciidoc b/docs/reference/mapping/params/geohash-precision.asciidoc index 6e4e859d03f..35020feea5f 100644 --- a/docs/reference/mapping/params/geohash-precision.asciidoc +++ b/docs/reference/mapping/params/geohash-precision.asciidoc @@ -1,6 +1,8 @@ [[geohash-precision]] === `geohash_precision` +deprecated[5.0.0, Will be removed in the next major version.] + Geohashes are a form of lat/lon encoding which divides the earth up into a grid. Each cell in this grid is represented by a geohash string. Each cell in turn can be further subdivided into smaller cells which are @@ -19,7 +21,7 @@ It accepts: If a distance is specified, it will be translated to the smallest geohash-length that will provide the requested resolution. -For example: +For example, using this mapping: [source,js] -------------------------------------------------- @@ -37,8 +39,16 @@ PUT my_index } } } +-------------------------------------------------- +// CONSOLE +// TEST[warning:geo_point geohash_precision parameter is deprecated and will be removed in the next major release] +// TEST[warning:geo_point geohash_prefix parameter is deprecated and will be removed in the next major release] +// TEST[warning:geo_point geohash parameter is deprecated and will be removed in the next major release] -PUT my_index/my_type/1 +You can issue this index and query: +[source,js] +-------------------------------------------------- +PUT my_index/my_type/1?refresh { "location": { "lat": 41.12, @@ -57,4 +67,6 @@ GET my_index/_search?fielddata_fields=location.geohash -------------------------------------------------- // CONSOLE +// TEST[continued] + <1> A `geohash_precision` of 6 equates to geohash cells of approximately 1.26km x 0.6km diff --git a/docs/reference/mapping/params/geohash-prefix.asciidoc b/docs/reference/mapping/params/geohash-prefix.asciidoc index 56f0b42ae8d..33bd21bdeb6 100644 --- a/docs/reference/mapping/params/geohash-prefix.asciidoc +++ b/docs/reference/mapping/params/geohash-prefix.asciidoc @@ -1,6 +1,9 @@ [[geohash-prefix]] === `geohash_prefix` +deprecated[5.0.0, Will be removed in the next major version.] + + Geohashes are a form of lat/lon encoding which divides the earth up into a grid. Each cell in this grid is represented by a geohash string. Each cell in turn can be further subdivided into smaller cells which are @@ -37,7 +40,13 @@ PUT my_index } } } +-------------------------------------------------- +// TEST[warning:geo_point geohash_precision parameter is deprecated and will be removed in the next major release] +// TEST[warning:geo_point geohash_prefix parameter is deprecated and will be removed in the next major release] +// TEST[warning:geo_point geohash parameter is deprecated and will be removed in the next major release] +[source,js] +-------------------------------------------------- PUT my_index/my_type/1 { "location": { @@ -61,4 +70,4 @@ GET my_index/_search?fielddata_fields=location.geohash } -------------------------------------------------- // CONSOLE - +// TEST[continued] diff --git a/docs/reference/mapping/params/geohash.asciidoc b/docs/reference/mapping/params/geohash.asciidoc index d362d373437..95f91fc6e86 100644 --- a/docs/reference/mapping/params/geohash.asciidoc +++ b/docs/reference/mapping/params/geohash.asciidoc @@ -1,6 +1,8 @@ [[geohash]] === `geohash` +deprecated[5.0.0, Will be removed in the next major version.] + Geohashes are a form of lat/lon encoding which divides the earth up into a grid. Each cell in this grid is represented by a geohash string. Each cell in turn can be further subdivided into smaller cells which are @@ -17,7 +19,7 @@ as, eg `.geohash`. The length of the geohash is controlled by the If the <> option is enabled, the `geohash` option will be enabled automatically. -For example: +For example, with this mapping: [source,js] -------------------------------------------------- @@ -34,9 +36,15 @@ PUT my_index } } } +-------------------------------------------------- +// CONSOLE +// TEST[warning:geo_point geohash parameter is deprecated and will be removed in the next major release] +You can index a document and use this query: -PUT my_index/my_type/1 +[source,js] +-------------------------------------------------- +PUT my_index/my_type/1?refresh { "location": { "lat": 41.12, @@ -54,6 +62,8 @@ GET my_index/_search?fielddata_fields=location.geohash <2> } -------------------------------------------------- // CONSOLE +// TEST[continued] + <1> A `location.geohash` field will be indexed for each geo-point. <2> The geohash can be retrieved with <>. <3> A <> query can find all geohashes which start with a particular prefix. @@ -66,5 +76,3 @@ A `prefix` query on geohashes is expensive. Instead, consider using the instead of on every query. ============================================ - - diff --git a/docs/reference/mapping/params/lat-lon.asciidoc b/docs/reference/mapping/params/lat-lon.asciidoc index 88c91c30d06..002f91ef3f3 100644 --- a/docs/reference/mapping/params/lat-lon.asciidoc +++ b/docs/reference/mapping/params/lat-lon.asciidoc @@ -34,7 +34,7 @@ PUT my_index // TEST[warning:geo_point lat_lon parameter is deprecated and will be removed in the next major release] <1> Setting `lat_lon` to true indexes the geo-point in the `location.lat` and `location.lon` fields. -Allows these actions: +With this document: [source,js] -------------------------------------------------- @@ -45,8 +45,14 @@ PUT my_index/my_type/1?refresh "lon": -71.34 } } +-------------------------------------------------- +// CONSOLE +// TEST[continued] +Allows this query: +[source,js] +-------------------------------------------------- GET my_index/_search { "query": { @@ -63,6 +69,7 @@ GET my_index/_search -------------------------------------------------- // CONSOLE // TEST[continued] +// TEST[warning:Deprecated field [optimize_bbox] used, replaced by [no replacement: `optimize_bbox` is no longer supported due to recent improvements]] <1> The `indexed` option tells the geo-distance query to use the inverted index instead of the in-memory calculation. Whether the in-memory or indexed operation performs better depends both on diff --git a/docs/reference/query-dsl/geohash-cell-query.asciidoc b/docs/reference/query-dsl/geohash-cell-query.asciidoc index 27e6319bc71..e6bcfea0288 100644 --- a/docs/reference/query-dsl/geohash-cell-query.asciidoc +++ b/docs/reference/query-dsl/geohash-cell-query.asciidoc @@ -30,7 +30,9 @@ PUT /my_index } -------------------------------------------------- // CONSOLE -// TESTSETUP +// TEST[warning:geo_point geohash parameter is deprecated and will be removed in the next major release] +// TEST[warning:geo_point geohash_precision parameter is deprecated and will be removed in the next major release] +// TEST[warning:geo_point geohash_prefix parameter is deprecated and will be removed in the next major release] The geohash cell can defined by all formats of `geo_points`. If such a cell is defined by a latitude and longitude pair the size of the cell needs to be @@ -67,6 +69,7 @@ GET /_search } -------------------------------------------------- // CONSOLE +// TEST[continued] [float] ==== Ignore Unmapped