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] use stored map buffer to generate queries for search sessions #91148

Merged
merged 8 commits into from
Feb 17, 2021

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Feb 11, 2021

Partial fix for #90776

Elasticsearch queries for map layers contain an extent filter to limit results to those around the visible map area. This causes problems with search sessions because if the screen size changes at all, then the extent filter will not match the stored search session query and there will be a cache miss.

This PR solves this problem by storing mapBuffer in the MapEmbeddable input state so that when search sessions are used, the stored mapBuffer can be used instead of the actual map buffer based on the screen size.

This solution is not perfect and there are 2 remaining problems with this approach.

  1. Embeddable input state is only persisted when dashboards are saved. This means that MapEmbeddable.input.mapBuffer will not exist for any map embeddable saved prior to 7.12. Users will experience the same error if using search sessions on these dashboards since the fallback will be to use the mapBuffer for the current screen size. This issue can be fixed by having users change the map view to set a new center/zoom/mapBuffer and then save the dashboard. Not a great experience, but better then broken map embeddable when using search sessions and no work around.
  2. If the search session is created on a very small screen and the the search session is viewed on a much larger screen, the user's current view port may extend past the cached mapBuffer area resulting in missing data around the edges of the map. The reason being is the query would use the cached map buffer instead of the actually buffer so less area would be queried. In practice, this will not occur often since the mapBuffer is the current view port plus 50% so the screen sizes would have to be very different and the work around is to create the search session on the larger screen.

@nreese nreese added [Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.12.0 labels Feb 11, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-gis (Team:Geo)

@nreese nreese requested a review from Dosant February 11, 2021 15:54
Copy link
Contributor

@Dosant Dosant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I validated that mapBuffer is now saved into panelsJson and that the maps search session is restored when the search was done with the same state that saved with the dashboard.

@nreese
Copy link
Contributor Author

nreese commented Feb 16, 2021

@elasticmachine merge upstream

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
maps 2.6MB 2.6MB +285.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@nreese nreese merged commit 3e54974 into elastic:master Feb 17, 2021
nreese added a commit to nreese/kibana that referenced this pull request Feb 17, 2021
…lastic#91148)

* [Maps] use stored map buffer to generate queries for search sessions

* getDataFilters unit test

* tslint

* update setQuery unit tests

* only set searchSessionMapBuffer when search session isRestore

* tslint

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
nreese added a commit that referenced this pull request Feb 17, 2021
…91148) (#91752)

* [Maps] use stored map buffer to generate queries for search sessions

* getDataFilters unit test

* tslint

* update setQuery unit tests

* only set searchSessionMapBuffer when search session isRestore

* tslint

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Deprecated-Use Team:Presentation]Team:Geo Former Team Label for Geo Team. Now use Team:Presentation release_note:skip Skip the PR/issue when compiling release notes v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants