Composite vs term aggregation with size

If I am using terms aggregation with size let's say 100000(knowing that there will not be more entry then it), should it return same result as using composite aggregation?

The composite aggregation should return the same terms but in a different order. The terms aggregation orders the terms by doc_count by default whereas the composite uses the natural sort order (alphanumeric sort).

Thanks for a reply. I have doubt if term would result the entire set of data even if I know my cardinality. Let's say I defined size as 100000. Will it return the entire data.

Avoid packing too many buckets into one response.
Look at making multiple requests using the “after” parameter in composite agg or the “partition” parameter in terms agg.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.