Skip to content
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

Merged
merged 4 commits into from
Jan 20, 2021

Conversation

iverase
Copy link
Contributor

@iverase iverase commented Jan 18, 2021

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.

@iverase iverase added >enhancement :Analytics/Geo Indexing, search aggregations of geo points and shapes v8.0.0 v7.12.0 labels Jan 18, 2021
@iverase iverase requested a review from talevy January 18, 2021 09:09
@elasticmachine elasticmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jan 18, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo (Team:Analytics)

Copy link
Contributor

@talevy talevy left a 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)")
Copy link
Contributor

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)?

Copy link
Contributor Author

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.

@iverase iverase merged commit 808b4e7 into elastic:master Jan 20, 2021
@iverase iverase deleted the spatialRelGeoPoint branch January 20, 2021 13:20
iverase added a commit that referenced this pull request Jan 20, 2021
…7762)

Lucene 8.8 supports to query LatLonPoint field using spatial relationships.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v7.12.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants