-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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 advanced setting to turn off search on Discover's initial page load #42036
Conversation
Pinging @elastic/kibana-app |
💔 Build Failed |
jenkins test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, tested locally with Chrome, I found one thing to discuss:
When you set a refresh interval, reload discover, initially the unintializedText is displayed until the first interval period is over. I think it would be better to also start the reloading after the first click on refresh
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM.
I tested the implementation and setting the searchOnPageLoad
to false prevents the initial query being sent. The setting also prevents a query being sent on page load if a filter or a query or a date filter has already been applied when navigating away from Discover to another application (Visualize for example) and then navigating back to Discover if no action was taken in the other app.
The steps I took are:
- Add a filter and issue the request in Discover. We get the results from the search:
- Navigate away from Discover to another app but don't load anything:
- Go back to Discover and the filter/query/date filters are still present but the search request was not issued.
The implementation satisfies the intent of preventing requests on every initial load if the setting is applied and a saved search is not being loaded.
* Search on page load if refresh interval is set * Search as soon as auto refresh is turned on
@kertal I agree with you, the interaction with the auto refresh was a bit weird. I've made two changes:
@TinaHeiligers The scenario you outlined is one I thought about a bit. If a user is bouncing between apps and they've already applied a query and/or filters in Discover, I'm not sure if they would want to automatically load results every time they bounce to Discover or not. On the one hand, since they entered the query then maybe they want to see those results. On the other hand the old query may be stale and they may be coming back to Discover to execute a new query. Since the primary use of this setting is to reduce load I erred on the side of not automatically loading results in this situation. I figure if someone wants to reference back to one specific query frequently, they can keep it open in a separate tab. |
@AlonaNadler would you like to take a look at this before it is merged? |
💚 Build Succeeded |
@Bargs haven't checked it out yet just by the screen I have a few suggestions:
|
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM, now the refresh interval behaviour is fine, tested with Chrome
Hey @Bargs I'm gonna push you a PR soon that will fill in that empty state. cc @AlonaNadler |
PR4U: Bargs#8 |
Thanks for the PR @cchaos. The only thing I noticed is that the discover results also have a border around them now. Is that intentional? |
💔 Build Failed |
Yes the main results now live in a panel, similar to how we handle other pages within Kibana. |
💚 Build Succeeded |
…ad (elastic#42036) Discover currently executes a search as soon as it loads. For some users this is useful. But for others it may return worthless results at the expense of extra load on their ES cluster and increased page load times, making it harder to get to the data they actually want. This PR adds an advanced setting allowing users to turn off the "search on page load" functionality in Discover.
…ad (#42036) (#42408) Discover currently executes a search as soon as it loads. For some users this is useful. But for others it may return worthless results at the expense of extra load on their ES cluster and increased page load times, making it harder to get to the data they actually want. This PR adds an advanced setting allowing users to turn off the "search on page load" functionality in Discover.
Summary
Related to #7238
Discover currently executes a search as soon as it loads. For some users this is useful. But for others it may return worthless results at the expense of extra load on their ES cluster and increased page load times, making it harder to get to the data they actually want. This PR adds an advanced setting allowing users to turn off the "search on page load" functionality in Discover.
One thing to note is that I chose to continue loading results immediately when loading a saved search (for example, from a bookmark). If you're loading a specific saved search, I think that's an indication that you're interested in seeing its results immediately.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] This was checked for cross-browser compatibility, including a check against IE11- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately