Inconsistent aggregation results

I am trying to run a terms aggregation to return a list of unique values. But each time I run the aggregation I get a different number of buckets returned.
I have terms aggregation which has a sub aggregation to give me the top 5 values for each unique term.
Top level aggregation varies the number of buckets returned every time I run it. It has a size set to 1000 and from what I can work out when it works it returns about 269 results but can returns less buckets.
Am I not understanding a how Elasticsearch does aggregations or am I doing something stupid. Should I be using a composite aggregation to page through the results instead with a smaller size?
Am querying daily indices over about 30 days. Each index has 3 shards and 1 replica on 13 data nodes.

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