Control number of buckets created in an aggregation

Works OK on 6.x - I'll need to dig deeper into what changed in 7.x.
Looks like the shard_size multiplier is still in effect for a single-sharded system.
The good news is if you also set shard_size to 8000 it should work OK (does for me here).

FYI - not sure if your example with "unique" agg on "_id" field is representative but if you just want to count docs this will be much cheaper:

GET my_index/_count
1 Like