Setting size to 0 will return all aggregations (or, rather, Integer.MAX_VALUE). This is not documented, since its really not recommended and should be used with care ( memory footprint for aggregations are quite heavy). It will probably also be deprecated in future versions, since this is no longer supported by Elasticsearch.
If you really needs to return all aggregations, you should just pick a number that you are sure will be enough, based on e.g the total number of documents matching your query * the number of expected fields values possible in the field.