OpenSearch/docs/reference/aggregations
Luca Cavanna 42ea644903
Remove single shard optimization when suggesting shard_size (#37041)
When executing terms aggregations we set the shard_size, meaning the
number of buckets to collect on each shard, to a value that's higher than
the number of requested buckets, to guarantee some basic level of
precision. We have an optimization in place so that we leave shard_size
set to size whenever we are searching against a single shard, in which
case maximum precision is guaranteed by definition.

Such optimization requires us access to the total number of shards that
the search is executing against. In the context of cross-cluster search,
once we will introduce multiple reduction steps (one per cluster) each
cluster will only know the number of local shards, which is problematic
as we should only optimize if we are searching against a single shard in a
single cluster. It could be that we are searching against one shard per cluster
in which case the current code would optimize number of terms causing
a loss of precision.

While discussing how to address the CCS scenario, we decided that we do
not want to introduce further complexity caused by this single shard
optimization, as it benefits only a minority of cases, especially when
the benefits are not so great.

This commit removes the single shard optimization, meaning that we will
always have heuristic enabled on how many number of buckets to collect
on the shards, even when searching against a single shard.

This will cause more buckets to be collected when searching against a single
shard compared to before. If that becomes a problem for some users, they
can work around that by setting the shard_size equal to the size.

Relates to #32125
2019-01-02 17:45:49 +01:00
..
bucket Remove single shard optimization when suggesting shard_size (#37041) 2019-01-02 17:45:49 +01:00
matrix Allow `_doc` as a type. (#27816) 2017-12-14 17:47:53 +01:00
metrics Make hits.total an object in the search response (#35849) 2018-12-05 19:49:06 +01:00
pipeline Added keyed response to pipeline percentile aggregations 22302 (#36392) 2018-12-14 16:22:54 -05:00
bucket.asciidoc Add parent-aggregation to parent-join module (#34210) 2018-11-08 14:13:00 +01:00
matrix.asciidoc refactor matrix agg documentation from modules to main agg section 2016-06-06 07:39:00 -05:00
metrics.asciidoc median absolute deviation agg (#34482) 2018-10-30 07:22:52 -07:00
misc.asciidoc Make hits.total an object in the search response (#35849) 2018-12-05 19:49:06 +01:00
pipeline.asciidoc Add a MovingFunction pipeline aggregation, deprecate MovingAvg agg (#29594) 2018-05-16 10:57:00 -04:00