Diversified sampler aggregation #
Like
sampler, but the sample is diversified by a field
— up to one (or few) documents per value — so rare categories survive
the sampling.
Example #
Sample with at most one document per product type: all four types
appear instead of being dominated by t-shirt:
Parameters for diversified_sampler
#
shard_size
(Optional, integer, default:100000) Sample size per shard.field
(Required, string) Field used to diversify the sample.max_docs_per_value
(Optional, integer, default:1) Documents kept per distinct value.