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

Support Lucene push-down for distance filtering with ST_DISTANCE #109972

Closed
Tracked by #108212
craigtaverner opened this issue Jun 20, 2024 · 1 comment · Fixed by #110102
Closed
Tracked by #108212

Support Lucene push-down for distance filtering with ST_DISTANCE #109972

craigtaverner opened this issue Jun 20, 2024 · 1 comment · Fixed by #110102
Assignees
Labels
:Analytics/ES|QL AKA ESQL :Analytics/Geo Indexing, search aggregations of geo points and shapes >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@craigtaverner
Copy link
Contributor

craigtaverner commented Jun 20, 2024

Based on the specification at #108212, we have implemented the ST_DISTANCE function in the PR at #108764.

However, this does not perform any Lucene pushdown, and so will run slow for larger datasets. One approach to getting lucene pushdown to work is to rewrite the predicate from:

FROM airports
| WHERE ST_DISTANCE(location, TO_GEOPOINT("POINT(12 55)")) < 500000

to:

FROM airports
| WHERE ST_INTERSECTS(location, TO_GEOSHAPE("CIRCLE(POINT(12 55), 500000)"))

This re-write would NOT occur at the query parsing stage (as implied above), but should be done during Logical Plan optimization. Then the existing lucene pushdown for ST_INTERSECTS should work.

@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Jun 20, 2024
@craigtaverner craigtaverner changed the title Support Lucene push-down for distance filtering (using rewrite to ST_INTERSECTS(field, Circle)) ES|QL: Support Lucene push-down for distance filtering with ST_DISTANCE Jun 20, 2024
@craigtaverner craigtaverner self-assigned this Jun 20, 2024
@craigtaverner craigtaverner added >enhancement :Analytics/Geo Indexing, search aggregations of geo points and shapes Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) :Analytics/ES|QL AKA ESQL and removed needs:triage Requires assignment of a team area label labels Jun 20, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@craigtaverner craigtaverner changed the title ES|QL: Support Lucene push-down for distance filtering with ST_DISTANCE Support Lucene push-down for distance filtering with ST_DISTANCE Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL :Analytics/Geo Indexing, search aggregations of geo points and shapes >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants