-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cut over geo_point field and queries to new LatLonPoint type #20315
Conversation
@colings86 @rjernst @mikemccand please could you review this - @jpountz is away |
import java.io.IOException; | ||
|
||
/** | ||
* Created by nknize on 8/23/16. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe change these boilerplates to a real javadoc?
Thanks @nknize, I looked at the Lucene usage here and left a few small comments. Are you planning on exposing
|
Thanks for the review @mikemccand! I'll address the feedback and update the PR.
I'm also planning to add nearest neighbor in another PR,. |
++, these both can be done separately. |
ab47328
to
ba0b77d
Compare
48e21ac
to
ccc4c1f
Compare
The Lucene parts LGTM, thanks @nknize! I do think |
@@ -143,7 +143,16 @@ public abstract Y build(BuilderContext context, String simpleName, MappedFieldTy | |||
FieldMapper geoHashMapper, MultiFields multiFields, Explicit<Boolean> ignoreMalformed, CopyTo copyTo); | |||
|
|||
public Y build(Mapper.BuilderContext context) { | |||
GeoPointFieldType geoPointFieldType = (GeoPointFieldType)fieldType; | |||
// version 5.0 cuts over to LatLonPoint and no longer indexes geohash, or lat/lon separately | |||
if (context.indexCreatedVersion().before(Version.V_5_0_0_alpha6)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this must be updated to onOrBefore
this look great, @nknize I notice that this removes tons of docs but doesn't add new docs how is this going to work? do we have to add docs later? |
test this please |
ccc4c1f
to
3537cbb
Compare
Thanks @s1monw! I talked to @clintongormley about updating docs in a separate PR to make it easier to review. |
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
ed5225d
to
5af9eef
Compare
This commit removes documentation for: * geohash cell query * lat_lon parameter * geohash parameter * geohash_precision parameter * geohash_prefix parameter It also updates failing tests that reference these parameters for backcompat.
5af9eef
to
1a60e1c
Compare
@nknize I think the Should I open a new issue to fix this? |
Nice catch @mikemccand I agree the multi-poly should be passed to LatLonPoint. Go ahead and open the issue and I'll make the change. Thx! |
This PR cuts over
geo_point
fields to use Lucene's new point-basedLatLonPoint
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:lat_lon
andgeohash
parameterslat_lon
andgeohash
parameters is added to all unit and integration testsLatLonPointFieldMapper
provides DocValues support (enabled by default) which uses Lucene's newLatLonDocValuesField
typeLatLonPoint
field data classes are added for aggregation support (wraps LatLonPoint's Numeric Doc Values)Removed Features:
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,geo_distance_range
queries should be accomplished using either thegeo_distance
aggregation, sorting by descending distance on ageo_distance
query, or a booleanmust not
using the excluded distance (distance_range
query was syntactic sugar for this).closes #20314