# Deprecated size:0 on terms aggregation

**URL:** <https://discuss.elastic.co/t/deprecated-size-0-on-terms-aggregation/95726>\
**Category:** Elasticsearch\
**Created:** [August 3, 2017, 1:41pm UTC](https://discuss.elastic.co/t/deprecated-size-0-on-terms-aggregation/95726 "2017-08-03T13:41:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhondup](https://avatars.discourse-cdn.com/v4/letter/d/f1d935/32.png) [@dhondup](https://discuss.elastic.co/u/dhondup)\
**Post date:** [August 3, 2017, 1:41pm UTC](https://discuss.elastic.co/t/deprecated-size-0-on-terms-aggregation/95726/1 "2017-08-03T13:41:19Z")

</div>

According to Elastic docs, size: 0 on terms aggregation will be deprecated. Please see [https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking\_50\_aggregations\_changes.html#\_literal\_size\_0\_literal\_on\_terms\_significant\_terms\_and\_geohash\_grid\_aggregations](https://www.elastic.co/guide/en/elasticsearch/reference/5.0/breaking_50_aggregations_changes.html#_literal_size_0_literal_on_terms_significant_terms_and_geohash_grid_aggregations)

In the prior versions of Elasticsearch, size of 0 results in size being set to Integer.MAX\_VALUE. It seems to return all the buckets. How can I achieve the functionality of size: 0 in Elasticsearch 5.x?

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [August 3, 2017, 1:48pm UTC](https://discuss.elastic.co/t/deprecated-size-0-on-terms-aggregation/95726/2 "2017-08-03T13:48:49Z")

</div>

> How can I achieve the functionality of size: 0

Set it to a big number - it should make you pause for thought and consider the memory overheads involved in doing this.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 31, 2017, 1:49pm UTC](https://discuss.elastic.co/t/deprecated-size-0-on-terms-aggregation/95726/3 "2017-08-31T13:49:21Z")

</div>

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