-
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
Fix issue with overwritten filters #17713
Conversation
💔 Build Failed |
7c7d487
to
fd86ca1
Compare
💔 Build Failed |
Jenkins, test this - the saved search was missing in the test case? |
💔 Build Failed |
💚 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.
LGTM
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.
LGTM
Seems like we need to add some tests to both timelion & vega to check for this. |
Since timelion and Vega doesn't support this at all, there is at the moment no need to add tests for it :) (see #17719) |
* Fix issue with overwritten filters * Add tests * Only add timerange filter predicate if index exists
Fixes #17644
This fixes overwriting filters on the search source in courier request handler, and thus losing all filters saved with the visualization.
After talking to @spalger we decided, that we don't start passing filters/queries explicitly for now in this place, without having a clear idea about how the removal of inheritance in search source would work in all of Kibana. Search source is currently built around inheritance, and breaking it in just one tiny part (the courier request handler) we cannot assure, that anything would still work properly.
So instead we are doing the very "easy" solution, by just inheriting another time per request from the
searchSource
and apply the timeRange filter to that search source. We still need two more modifications for this to work:searchSource
, but the request will actually be written intorequestSearchSource
's history. This works by mirroring both. @spalger in contrast to our discussions on Friday, I haven't put this in a general way into theinherit
method, since this a) would have cluttered theSearchSource
class even more for just this one small usage of it, that b) can be removed as soon as the inspector (Replace spy panels by Inspector #16387) is implemented, since it's currently the only feature usinghistory
at all. So I rather decided to leave it in the courier request handler, and thus this simpledefineProperty
works, without needing to take care of overwriting the property if inheritance should change, etc.onRequestStart
handlers, since these will be used to properly trigger preflight requests (e.g. determine the interval for date histograms with auto interval). If we don't trigger thesearchSource
handlers only therequestSearchSource
handlers, the preflight requests attached tovis
won't be triggered properly. This needs to be configurable by a flag, since we would otherwise trigger parent handlers also for the postflight requests, since they inherit fromrequestSearchSource
, but we don't want one preflight request trigger per postflight request.cc @stacey-gammon (for information about the postpone of explicit filter/query passing - also feel free to review, if you have the time :))