-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Add support for Spatial Relationships to geo_point field #67631
Conversation
Pinging @elastic/es-analytics-geo (Team:Analytics) |
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.
just had one small nit for a test, but otherwise LGTM
|
||
client().prepareIndex("test").setId("1").setSource(jsonBuilder() | ||
.startObject() | ||
.field(defaultGeoFieldName, "POINT(-35 -25)") |
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.
should this be MULTIPOINT(-35 -25)
?
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.
The test is testing MultiPoint queries, so indexing a single point is intended. Note that unfortunately you cannot index a multipoint on a geo_point filed using WKT.
In. #52382 support for geo_shape queries over geo_pint fields was added with the limitation that only INTERSECTS spatial relationships were allowed. This was mainly due to a limitation on Lucene implementation.
With the upgrade to Lucene 8.8, this limitation has been removed. Therefore this PR adds the possibility to query geo_point fields using any of the supported spatial relationships.with this change, querying geo_point or geo_shape fields should be transparent to a user as they support the same type of queries.
Note that in this PR, query processors are removed and the logic to constructs Lucene queries is moved to the Field types.