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

Polygon query for geo_point field should pass the multi-polygon to LatLonPoint #20789

Closed
mikemccand opened this issue Oct 6, 2016 · 5 comments
Assignees
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >enhancement Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo)

Comments

@mikemccand
Copy link
Contributor

This is a follow-on to #20315, where we cutover to LatLonPoint for faster geo shape filtering.

But we still make a big BooleanQuery when a multi-polygon (a union of top-level polygons, with or without internal holes) is passed.

This is in general far slower than passing the entire multi-polyon to LatLonPoint.

@nknize
Copy link
Contributor

nknize commented Nov 15, 2016

I must've had a mental moment here. At the moment the geo_polygon query is naive. It does not support multi polygons or polygons with holes. It only supports an array of points defining a polygon shell. Only geo_shape query supports the Russian polygon. Changing geo_polygon to support complex shapes over geo_point types is on my todo list, but the shape validation phase needs to be sped up first.

That being said, rewriting a boolean query containing only geo_polygon queries to a LatLonPoint.newPolygonQuery would be a nice to have, but I think too difficult? and probably unnecessary since I'm working to refactor geo_shape to a BKD based encoding anyway.

@mikemccand
Copy link
Contributor Author

Hmm I see. So users today must parse the polygon client side and build up their own (slow) BooleanQuery?

It seems like we should just improve geo_polygon to accept multi polygons, polygons with holes, etc., since Lucene's LatLonPoint does, and does so very efficiently? Or maybe we add a new geo_multipolygon query?

I agree we shouldn't invest in rewriting BQ automagically ... better to provide the right query to begin with.

@nknize
Copy link
Contributor

nknize commented Nov 15, 2016

Or maybe we add a new geo_multipolygon query?

I like this approach. Its straight forward and easy to implement and maintain.

@imotov
Copy link
Contributor

imotov commented Dec 11, 2018

We should probably revisit this after #32039 since we are changing quite a bit there.

@imotov imotov added the stalled label Dec 11, 2018
@imotov imotov removed the stalled label Jan 7, 2019
@rjernst rjernst added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label May 4, 2020
@iverase
Copy link
Contributor

iverase commented Feb 9, 2021

Superseed by #48928

@iverase iverase closed this as completed Feb 9, 2021
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)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants