From ef926894f428f782073170173f2b1d144f42062f Mon Sep 17 00:00:00 2001 From: Nicholas Knize Date: Wed, 24 Aug 2016 13:53:38 -0500 Subject: Cut over geo_point field and queries to new LatLonPoint type This commit cuts over geo_point fields to use Lucene's new point-based LatLonPoint type for indexes created in 5.0. Indexes created prior to 5.0 continue to use their respective encoding type. Below is a description of the changes made to support the new encoding type: * New indexes use a new LatLonPointFieldMapper which provides a parse method for the new type * The new LatLonPoint parse method removes support for lat_lon and geohash parameters * Backcompat testing for deprecated lat_lon and geohash parameters is added to all unit and integration tests * LatLonPointFieldMapper provides DocValues support (enabled by default) which uses Lucene's new LatLonDocValuesField type * New LatLonPoint field data classes are added for aggregation support (wraps LatLonPoint's Numeric Doc Values) * MultiFields use the geohash as the string value instead of the lat,lon string making it easier to perform geo string queries on the geohash instead of a lat,lon comma delimited string. Removed Features: * With the removal of geohash indexing, GeoHashCellQuery support is removed for all new indexes (still supported on existing indexes) * LatLonPoint does not support a Distance Range query because it is super inefficient. Instead, the geo_distance_range query should be accomplished using either the geo_distance aggregation, sorting by descending distance on a geo_distance query, or a boolean must not of the excluded distance (which is what the distance_range query did anyway). TODO: * fix/finish yaml changes for plugin and rest integration tests * update documentation --- .../search/suggest/completion/context/GeoContextMapping.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/src/main/java/org/elasticsearch/search/suggest/completion') diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java index 854a5fb0e1..bd1449bbfe 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/context/GeoContextMapping.java @@ -207,7 +207,8 @@ public class GeoContextMapping extends ContextMapping { if (field instanceof StringField) { spare.resetFromString(field.stringValue()); } else { - spare.resetFromIndexHash(Long.parseLong(field.stringValue())); + // todo return this to .stringValue() once LatLonPoint implements it + spare.resetFromIndexableField(field); } geohashes.add(spare.geohash()); } -- cgit v1.2.3