Browse Source

Deprecate geohash parameters for geo_point parser

This commit deprecates all geohash parameters in the geo_point field parser.
Nicholas Knize 9 years ago
parent
commit
8234fad9ca

+ 6 - 0
core/src/main/java/org/elasticsearch/index/mapper/BaseGeoPointFieldMapper.java

@@ -205,15 +205,21 @@ public abstract class BaseGeoPointFieldMapper extends FieldMapper implements Arr
                     builder.precisionStep(XContentMapValues.nodeIntegerValue(propNode));
                     iterator.remove();
                 } else if (propName.equals("geohash")) {
+                    deprecationLogger.deprecated(CONTENT_TYPE + " geohash parameter is deprecated and will be removed "
+                        + "in the next major release");
                     builder.enableGeoHash(XContentMapValues.lenientNodeBooleanValue(propNode));
                     iterator.remove();
                 } else if (propName.equals("geohash_prefix")) {
+                    deprecationLogger.deprecated(CONTENT_TYPE + " geohash_prefix parameter is deprecated and will be removed "
+                        + "in the next major release");
                     builder.geoHashPrefix(XContentMapValues.lenientNodeBooleanValue(propNode));
                     if (XContentMapValues.lenientNodeBooleanValue(propNode)) {
                         builder.enableGeoHash(true);
                     }
                     iterator.remove();
                 } else if (propName.equals("geohash_precision")) {
+                    deprecationLogger.deprecated(CONTENT_TYPE + " geohash_precision parameter is deprecated and will be removed "
+                        + "in the next major release");
                     if (propNode instanceof Integer) {
                         builder.geoHashPrecision(XContentMapValues.nodeIntegerValue(propNode));
                     } else {

+ 4 - 3
docs/reference/mapping/types/geo-point.asciidoc

@@ -105,16 +105,17 @@ The following parameters are accepted by `geo_point` fields:
 
     Should the geo-point also be indexed as a geohash in the `.geohash`
     sub-field? Defaults to `false`, unless `geohash_prefix` is `true`.
+    deprecated[2.4]
 
 <<geohash-precision,`geohash_precision`>>::
 
     The maximum length of the geohash to use for the `geohash` and
-    `geohash_prefix` options.
+    `geohash_prefix` options. deprecated[2.4]
 
 <<geohash-prefix,`geohash_prefix`>>::
 
     Should the geo-point also be indexed as a geohash plus all its prefixes?
-    Defaults to `false`.
+    Defaults to `false`. deprecated[2.4]
 
 <<ignore-malformed,`ignore_malformed`>>::
 
@@ -124,7 +125,7 @@ The following parameters are accepted by `geo_point` fields:
 <<lat-lon,`lat_lon`>>::
 
     Should the geo-point also be indexed as `.lat` and `.lon` sub-fields?
-    Accepts `true` and `false` (default).
+    Accepts `true` and `false` (default). deprecated[2.3]
 
 ==== Using geo-points in scripts