Sampler aggregation filters to a sample of top scoring documents from each shard • Top hits creates search result output • Shard routing matters • Use with care – can be slow! 19 Product search diversification { { "query": { ... }, "aggregations": { “diversifiedResults": { "diversified_sampler": { "field": “supplierId", "shard_size": 1000, "max_docs_per_value": 1 }, "aggregations": { “topDiversifiedDocuments": { "top_hits": { "from": 0, "size": 10 } ... }