# What is the purpose of "size":10000 in OpenSearch query? what is the max size limit in OpenSearch

**URL:** <https://forum.opensearch.org/t/what-is-the-purpose-of-size-10000-in-opensearch-query-what-is-the-max-size-limit-in-opensearch/20309>\
**Category:** OpenSearch\
**Tags:** discuss, troubleshoot\
**Created:** [July 15, 2024, 4:42pm UTC](https://forum.opensearch.org/t/what-is-the-purpose-of-size-10000-in-opensearch-query-what-is-the-max-size-limit-in-opensearch/20309 "2024-07-15T16:42:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![swapnilthosare08](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@swapnilthosare08](https://forum.opensearch.org/u/swapnilthosare08)\
**Post date:** [July 15, 2024, 4:42pm UTC](https://forum.opensearch.org/t/what-is-the-purpose-of-size-10000-in-opensearch-query-what-is-the-max-size-limit-in-opensearch/20309/1 "2024-07-15T16:42:56Z")

</div>

{  
“size”: 0,  
“query”: {  
“bool”: {  
“filter”: [  
{  
“range”: {  
“@time”: {  
“gte”: “2024-07-12T14:20:00Z”,  
“lt”: “2024-07-12T14:25:00Z”  
}  
}  
}  
],  
“must”: [  
{  
“term”: {  
“stst.keyword”: {  
“value”: “vk”  
}  
}  
}  
],  
“must\_not”: [  
{  
“terms”: {  
“app.keyowrd”: [  
“aap1”,  
“app2”,  
“app3”  
“app4”  
]  
}  
}  
]  
}  
},  
“aggs”: {  
“times”: {  
“date\_histogram”: {  
“field”: “@time”,  
“fixed\_interval”: “5m”  
},  
“aggs”: {  
“field1”: {  
“terms”: {  
“size”: 10000,  
“field”: “field1.keyword”  
},  
“aggs”: {  
“field2”: {  
“terms”: {  
“size”: 10000,  
“field”: “field2.keyword”  
},  
“aggs”: {  
“field3”: {  
“terms”: {  
“size”: 10000,  
“field”: “field3.keyword”  
},  
“aggs”: {  
“field4”: {  
“terms”: {  
“size”: 10000,  
“field”: “field4.keyword”  
},  
“aggs”: {  
“duravg”: {  
“avg”: {  
“field”: “timefield”  
}  
}  
}  
}  
}  
}  
}  
}  
}  
}  
}  
}  
}  
}

---

<div class="post-metadata">

**Author:** ![gaobinlong](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/gaobinlong/32/5242_2.png) [@gaobinlong](https://forum.opensearch.org/u/gaobinlong)\
**Post date:** [July 16, 2024, 4:51am UTC](https://forum.opensearch.org/t/what-is-the-purpose-of-size-10000-in-opensearch-query-what-is-the-max-size-limit-in-opensearch/20309/2 "2024-07-16T04:51:19Z")

</div>

You mean the size parameter in the terms aggregation? That means the max bucket size, at most 10000 buckets will be returned, the parameter limits up to 65,536.

---

<div class="post-metadata">

**Author:** ![swapnilthosare08](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@swapnilthosare08](https://forum.opensearch.org/u/swapnilthosare08)\
**Post date:** [July 16, 2024, 4:43pm UTC](https://forum.opensearch.org/t/what-is-the-purpose-of-size-10000-in-opensearch-query-what-is-the-max-size-limit-in-opensearch/20309/3 "2024-07-16T16:43:24Z")

</div>

Ok Thank for the response.

You mean the size parameter in the terms aggregation? **Yes, correct.**  
But If we don’t add size parameter in the terms aggregations then what is the impact on data?  
Is it necessary to add size parameter in terms aggregations?

---

<div class="post-metadata">

**Author:** ![gaobinlong](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.opensearch.org/gaobinlong/32/5242_2.png) [@gaobinlong](https://forum.opensearch.org/u/gaobinlong)\
**Post date:** [July 17, 2024, 2:14am UTC](https://forum.opensearch.org/t/what-is-the-purpose-of-size-10000-in-opensearch-query-what-is-the-max-size-limit-in-opensearch/20309/4 "2024-07-17T02:14:20Z")

</div>

The `size` parameter in terms aggregation defaults to 10, if you don’t specify the parameter, the it will only return the top 10 buckets, so it depends on your requirement.

---

<div class="post-metadata">

**Author:** ![swapnilthosare08](https://avatars.discourse-cdn.com/v4/letter/s/9de053/32.png) [@swapnilthosare08](https://forum.opensearch.org/u/swapnilthosare08)\
**Post date:** [July 17, 2024, 6:36am UTC](https://forum.opensearch.org/t/what-is-the-purpose-of-size-10000-in-opensearch-query-what-is-the-max-size-limit-in-opensearch/20309/5 "2024-07-17T06:36:34Z")

</div>

> [@swapnilthosare08](#):
>
> field1.k

@gaobinlong Thank you so much for the valuable information.
