OpenSearch/docs/reference/aggregations/bucket
Simon Willnauer e81804cfa4 Add a shard filter search phase to pre-filter shards based on query rewriting (#25658)
Today if we search across a large amount of shards we hit every shard. Yet, it's quite
common to search across an index pattern for time based indices but filtering will exclude
all results outside a certain time range ie. `now-3d`. While the search can potentially hit
hundreds of shards the majority of the shards might yield 0 results since there is not document
that is within this date range. Kibana for instance does this regularly but used `_field_stats`
to optimize the indexes they need to query. Now with the deprecation of `_field_stats` and it's upcoming removal a single dashboard in kibana can potentially turn into searches hitting hundreds or thousands of shards and that can easily cause search rejections even though the most of the requests are very likely super cheap and only need a query rewriting to early terminate with 0 results.

This change adds a pre-filter phase for searches that can, if the number of shards are higher than a the `pre_filter_shard_size` threshold (defaults to 128 shards), fan out to the shards
and check if the query can potentially match any documents at all. While false positives are possible, a negative response means that no matches are possible. These requests are not subject to rejection and can greatly reduce the number of shards a request needs to hit. The approach here is preferable to the kibana approach with field stats since it correctly handles aliases and uses the correct threadpools to execute these requests. Further it's completely transparent to the user and improves scalability of elasticsearch in general on large clusters.
2017-07-12 22:19:20 +02:00
..
adjacency-matrix-aggregation.asciidoc New AdjacencyMatrix aggregation 2017-01-20 15:49:31 +00:00
children-aggregation.asciidoc Add a shard filter search phase to pre-filter shards based on query rewriting (#25658) 2017-07-12 22:19:20 +02:00
datehistogram-aggregation.asciidoc Document aggregating by day of the week (#25602) 2017-07-07 14:16:53 -04:00
daterange-aggregation.asciidoc Update aggs reference documentation for 'keyed' options (#23758) 2017-04-18 15:57:50 +02:00
diversified-sampler-aggregation.asciidoc Scripting: Change keys for inline/stored scripts to source/id (#25127) 2017-06-09 08:29:25 -07:00
filter-aggregation.asciidoc Update filter-aggregation.asciidoc (#24138) 2017-04-17 18:46:13 -04:00
filters-aggregation.asciidoc Fix `other_bucket` on the `filters` agg to be enabled if a key is set. (#21994) 2016-12-09 09:48:48 +01:00
geodistance-aggregation.asciidoc Update aggs reference documentation for 'keyed' options (#23758) 2017-04-18 15:57:50 +02:00
geohashgrid-aggregation.asciidoc CONSOLEify geo aggregation docs 2017-03-30 21:28:52 -04:00
global-aggregation.asciidoc CONSOLE-ify global-aggregation.asciidoc 2017-01-20 14:36:51 -05:00
histogram-aggregation.asciidoc Compound order for histogram aggregations. (#22343) 2017-05-11 18:06:26 +01:00
iprange-aggregation.asciidoc Update aggs reference documentation for 'keyed' options (#23758) 2017-04-18 15:57:50 +02:00
missing-aggregation.asciidoc CONSOLEify some more aggregation docs 2017-05-16 17:25:24 -04:00
nested-aggregation.asciidoc Document 5.0 mapping changes. 2016-03-22 16:22:58 +01:00
range-aggregation.asciidoc Scripting: Change keys for inline/stored scripts to source/id (#25127) 2017-06-09 08:29:25 -07:00
reverse-nested-aggregation.asciidoc Docs: Add comma to reverse nested agg snippet 2017-03-17 14:07:18 +01:00
sampler-aggregation.asciidoc Add superset size to Significant Term REST response (#24865) 2017-06-02 09:45:15 +02:00
significantterms-aggregation.asciidoc Scripting: Change keys for inline/stored scripts to source/id (#25127) 2017-06-09 08:29:25 -07:00
significanttext-aggregation.asciidoc SignificantText aggregation - like significant_terms, but for text (#24432) 2017-05-24 13:46:43 +01:00
terms-aggregation.asciidoc Scripting: Change keys for inline/stored scripts to source/id (#25127) 2017-06-09 08:29:25 -07:00