Significant terms aggregation #
A multi-bucket aggregation returning terms that are unusually frequent in the current scope (foreground) compared with the whole index (background) — the classic “what’s special about this subset” query.
Example #
Which merchants over-index inside pending sales?
Buckets carry doc_count (foreground) and bg_count (background) —
with evenly-distributed demo data the scores stay low; skew your own
data and the winners surface.
Parameters for significant_terms
#
field
(Required, string) Keyword field you wish to aggregate.size
(Optional, integer, default:10) Maximum number of buckets.min_doc_count
(Optional, integer, default:1) Minimum foreground count per term.background_filter
(Optional, object) Query narrowing the background set.