# Query for large numbers

**URL:** <https://discuss.elastic.co/t/query-for-large-numbers/100986>\
**Category:** Elasticsearch\
**Created:** [September 19, 2017, 8:19am UTC](https://discuss.elastic.co/t/query-for-large-numbers/100986 "2017-09-19T08:19:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [September 19, 2017, 8:19am UTC](https://discuss.elastic.co/t/query-for-large-numbers/100986/1 "2017-09-19T08:19:27Z")

</div>

Hi I am trying to query for around 500K transactions per 5 minutes therefor I did:

curl -XGET '192.168.1.116:9200/filebeat-\*/log/\_search?pretty&size=500000' -H 'Content-Type: application/json' -d'

but I get null... when I do:

curl -XGET '192.168.1.116:9200/filebeat-\*/log/\_search?pretty&size=10000' -H 'Content-Type: application/json' -d'

I get a correct answer.

How can I

---

<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:** [September 19, 2017, 8:25am UTC](https://discuss.elastic.co/t/query-for-large-numbers/100986/2 "2017-09-19T08:25:26Z")

</div>

Size is limited to 10000. To return that number of results you will need to use [scroll query](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/search-request-scroll.html).

---

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [September 19, 2017, 8:29am UTC](https://discuss.elastic.co/t/query-for-large-numbers/100986/3 "2017-09-19T08:29:34Z")

</div>

so if I use this query as follows:

"POST /twitter/tweet/\_search?scroll=5m"

The query will be alive for 5 minutes and will gather all the info inside it for when started for 5 minutes?

---

<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:** [September 19, 2017, 8:31am UTC](https://discuss.elastic.co/t/query-for-large-numbers/100986/4 "2017-09-19T08:31:56Z")

</div>

No, you will need to use the scroll contexts to retrieve batch after batch through multiple requests. The scroll context will be kept alive for at most 5 minutes.

---

<div class="post-metadata">

**Author:** ![tomer](https://avatars.discourse-cdn.com/v4/letter/t/41988e/32.png) [@tomer](https://discuss.elastic.co/u/tomer)\
**Post date:** [September 19, 2017, 8:54am UTC](https://discuss.elastic.co/t/query-for-large-numbers/100986/5 "2017-09-19T08:54:23Z")

</div>

Thanks so I saw that by the "size" I decide how many hits are returned per "batch". Our product is not yet in production, therefore, I can't completely test this so maybe you can help me and tell me where do I see the total when there are more batches?

Now I can see them in the total term. I saw that also when I do size:5 I get it in the total even when there are more than five.

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/1/9/19ce1910a65364f7f9dccfbfdc3c8849608061fe.png)  
Is this the case for big numbers does this singular "total" term show the total?

---

<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:** [October 17, 2017, 8:54am UTC](https://discuss.elastic.co/t/query-for-large-numbers/100986/6 "2017-10-17T08:54:26Z")

</div>

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