Hello.
According to elasticsearch guide, terms aggregation size may be 0.
If set to 0, the size will be set to Integer.MAX_VALUE.
There is a problem with Terms aggregation at this bundle. If I set size to 0, it uses default size (10), because of this if.