Rare terms aggregation #
A multi-bucket aggregation that keeps only RARE terms — bucket keys
whose document count is at or below max_doc_count. The mirror image of
terms for finding the long tail.
Example #
Every product type sells ≥10 times; raise the bar to 15 and only
sticker (10 sales) survives:
Parameters for rare_terms
#
field
(Required, string) Keyword field you wish to aggregate.max_doc_count
(Optional, integer, default:1) Maximum document count for a term to be considered rare.include/exclude
(Optional) Restrict candidate terms (exact values or wildcard patterns).