Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Improve filtering for standard aggregation queries. #4056
Motivation and Context
This change improves the queries generated by the Searches#terms/fieldStats/histogram/fieldHistogram methods. By filtering the search result based on the specified time range in the query instead of the aggregation, overall ES runtime is improved.
Fortunately, filteredSearchRequest is already returning a matching query + time range search builder which can be used for those cases. Before this change, the source builder was generated by the specific method and contained only the query instead of query + time range.
Thanks to @hc4 for the input.
How Has This Been Tested?
Screenshots (if appropriate):
Sample runtimes for the histogram before the change:
Sample runtimes for the histogram after the change:
Types of changes