# Need Clarification Regarding Size Parameter in ES Query

**URL:** <https://discuss.elastic.co/t/need-clarification-regarding-size-parameter-in-es-query/278735>\
**Category:** Elasticsearch\
**Created:** [July 15, 2021, 4:32am UTC](https://discuss.elastic.co/t/need-clarification-regarding-size-parameter-in-es-query/278735 "2021-07-15T04:32:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sayamiasis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sayamiasis/32/91137_2.png) [@sayamiasis](https://discuss.elastic.co/u/sayamiasis)\
**Post date:** [July 15, 2021, 4:32am UTC](https://discuss.elastic.co/t/need-clarification-regarding-size-parameter-in-es-query/278735/1 "2021-07-15T04:32:38Z")

</div>

I wanted to know if there is a difference in executing these two queries when the result response is consisting of only 3 documents.

query1:

```json
{
	"size":10,
	"query": {
		"bool":{
			"must":[
				{
					"term":{
						"type":"sometype"
					}
				}
			]
		}
	}
}

```

query 2:

```json
{
	"size":2147483647,
	"query": {
		"bool":{
			"must":[
				{
					"term":{
						"type":"sometype"
					}
				}
			]
		}
	}
}

```

the query with size:10 gave immediate response (3 documents that existed), whereas the 2nd query took a whole long time and caused my ES to be unresponsive and ultimately went down.

I'd like to know the reason behind this.

Details: I was working in a 10 node cluster for a 2 TB index (size seems pretty huge for a 10 node cluster). Each node with 30 GB ES heap size.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 15, 2021, 6:06am UTC](https://discuss.elastic.co/t/need-clarification-regarding-size-parameter-in-es-query/278735/2 "2021-07-15T06:06:20Z")

</div>

Which version of Elasticsearch are you using? In recent versions I would expect the second query to fail before running.

---

<div class="post-metadata">

**Author:** ![sayamiasis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sayamiasis/32/91137_2.png) [@sayamiasis](https://discuss.elastic.co/u/sayamiasis)\
**Post date:** [July 15, 2021, 7:16am UTC](https://discuss.elastic.co/t/need-clarification-regarding-size-parameter-in-es-query/278735/3 "2021-07-15T07:16:54Z")

</div>

Sorry forgot to mention the verison.  
These queries were hit on ES Version: 7.11

Also, as i mentioned the 2nd query doesn't fail instanlty. Instead, it keeps running and brings the whole ES down. This problem was faced just for this case (2 tb index size with 10 nodes) . Haven't faced such issue in other configurations. However, my concern was, if its returning only 3 documents ultimately, it shouldn't have failed, regardless of the size parameter.

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [July 15, 2021, 7:23am UTC](https://discuss.elastic.co/t/need-clarification-regarding-size-parameter-in-es-query/278735/4 "2021-07-15T07:23:27Z")

</div>

Do you have any custom configuration? The size parameter should as far as I know by default be limited to 10000.

---

<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 12, 2021, 7:23am UTC](https://discuss.elastic.co/t/need-clarification-regarding-size-parameter-in-es-query/278735/5 "2021-08-12T07:23:59Z")

</div>

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