Term aggregation size 0

Setting size to 0 was dangerous as it could lead to the bucket explosion problem. A good practice should be for users to have a rough idea how many buckets to expect and to specify a reasonable bound for it.

If you worry about imprecisions, have a look at this section:

https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html#_shard_size_3