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

[Maps] point-to-point source can exceed default search.max_buckets and fail #46515

Closed
nreese opened this issue Sep 24, 2019 · 3 comments
Closed
Labels
bug Fixes for quality problems that affect the customer experience [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation discuss

Comments

@nreese
Copy link
Contributor

nreese commented Sep 24, 2019

Point-to-point source fetches the top 100 destination points and then runs a geotile_grid aggregation for each bucket. The geotile_grid aggregation is limited to top 500 buckets. Even with these constraints in place, the request could return 50,000 buckets. This will result in an exception for the request, because the default search.max_buckets is breached.

point-to-point should use composite aggregation to break the request into pieces to ensure the default search.max_buckets is not breached.

With composite aggs, point-to-point could also be expanded to support more than 100 destinations.

@nreese nreese added bug Fixes for quality problems that affect the customer experience [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation labels Sep 24, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis

@thomasneirynck
Copy link
Contributor

thomasneirynck commented Oct 16, 2019

Originally in separate ticket (#47895), but will paste this here as that is a proposal to address this issue (different from using _scroll)


The point-2-point layer uses a grid aggregation nested under a terms aggregation to construct a line from all origins to a single unique destination.

This creates an approximate line to a destination that gets finer and finer as users zoom in.

There are worst-case scenarios where this strains Elasticsearch.

  • when zoomed in, the origins are aggregated on a really fine grid. When the origins fall outside the bounds, they are not even visible.
  • when there are many nearby destinations, with slightly varying coordinates., These are really just noise when zoomed out.

Consider:

(a) Add a spatial filter so the origins need to fall inside the bounds, and not just the destination. The result is the line would only be visible if both destination and origin are in the bounds
(b) The top level aggregation is not a term-agg on destinations, but a grid-agg itself, using the geo-centroid to approximate the location
These changes would not really impact negatively on the purpose of this layer-type (imo).

(a) Already lines will "blip"-in and out depending on whether the destination is inside the view. This just tightens this restriction.
(b) The exact destination location is not required to preserve the visual effect. Only the aggregate values for the line. Zooming in on the destination will refine the grid.

The advantage is that it cuts down on the size of the aggregration, especially when zoomed in, or when there are many destinations.

@nreese
Copy link
Contributor Author

nreese commented Jun 30, 2020

closed by elastic/elasticsearch#57042

@nreese nreese closed this as completed Jun 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation discuss
Projects
None yet
Development

No branches or pull requests

3 participants