Skip to content

Commit 345cf2d

Browse files
committed
Adds a note in the terms aggregation docs regarding pagination (#28360)
This change adds a note in the `terms` aggregation that explains how to retrieve **all** terms (or all combinations of terms in a nested agg) using the `composite` aggregation.
1 parent 45cb32e commit 345cf2d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

docs/reference/aggregations/bucket/terms-aggregation.asciidoc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ This means that if the number of unique terms is greater than `size`, the return
114114
(it could be that the term counts are slightly off and it could even be that a term that should have been in the top
115115
size buckets was not returned).
116116

117+
NOTE: If you want to retrieve **all** terms or all combinations of terms in a nested `terms` aggregation
118+
you should use the <<search-aggregations-bucket-composite-aggregation,Composite>> aggregation which
119+
allows to paginate over all possible terms rather than setting a size greater than the cardinality of the field in the
120+
`terms` aggregation. The `terms` aggregation is meant to return the `top` terms and does not allow pagination.
121+
117122
[[search-aggregations-bucket-terms-aggregation-approximate-counts]]
118123
==== Document counts are approximate
119124

0 commit comments

Comments
 (0)