-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Underlying Elasticsearch queries do not use filter context when appropriate #8367
Comments
This sounds reasonable enough, we need to be careful to not negatively impact scoring with this. Are any of these queries calculating meaningful score values? |
So my expectation is that any query parameters entered in the search box should influence scoring, while any query parameters resulting from a "drill down" (aka selection of a value or range in a visualization) should not influence scoring -- that they are simply filtering criteria. |
@spalger do you know if there's any reason to calculate score when we're not sorting on score? I'm thinking these could even dynamically switch between query and filter context depending on what we're sorting on. |
I don't want to presume that Kibana is only used for time-series use cases but until Kibana provides the ability for users to control relevancy, my inclination is to say that scoring is not very meaningful in Kibana. Maybe there's a use case I'm not considering... |
Yeah sorting by score generally only happens by default when using a non-time based index pattern I believe. Otherwise it sorts by your default timestamp field |
I know that we supported sorting on score at some point, but I'm not 100% sure that it was something you could ever do without modifying the url directly. |
Should we close this, seeing as how Elasticsearch no longer supports "filters"? |
@lukasolson I think it's still relevant. We never put any queries under the filter context, but we probably should for anything that the user wouldn't expect to contribute to scoring in order to take advantage of the filter cache. |
This is absolutely still relevant because it's a regression introduced in version 5. Filters were put in the filter context in past Kibana versions and they need to do this again. |
Here's the 4.6 branch using the filtered query when it existed causing filters to not be used in scoring and use the filter cache. Here's the 5.0 branch that didn't take Elasticsearch's advice on how to convert filtered queries to the new bool query syntax and put filters in must and must_not. Here's Elasticsearch's documentation on how to convert filtered queries. |
Kibana version: 5.0.0 alpha5
Elasticsearch version: 5.0.0 alpha5
Description of the problem including expected versus actual behavior:
I viewed the Request for a Vertical Bar Chart visualization, expecting the queries for the selected time range in the Dashboard and "drill down" selections to be explicitly defined in the filter context of the Elasticsearch query. However, I noticed they were added to the 'must' clause of the boolean query instead of the filter clause. Unless I'm misunderstanding something, this will result in the "filters" not being cached in the ES filter cache and add latency due to influencing scoring.
e.g. instead of:
I think it should ideally be generated to:
Steps to reproduce:
The text was updated successfully, but these errors were encountered: