# How to set the query resultset size to infinite

**URL:** https://discuss.elastic.co/t/how-to-set-the-query-resultset-size-to-infinite/18229
**Category:** Elasticsearch
**Created:** [June 20, 2014, 9:07am UTC](https://discuss.elastic.co/t/how-to-set-the-query-resultset-size-to-infinite/18229 "2014-06-20T09:07:56Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Nuno\_Carvalho](https://avatars.discourse-cdn.com/v4/letter/n/58956e/32.png) [@Nuno\_Carvalho](https://discuss.elastic.co/u/Nuno_Carvalho)
#### Post date: [June 20, 2014, 9:07am UTC](https://discuss.elastic.co/t/how-to-set-the-query-resultset-size-to-infinite/18229/1 "2014-06-20T09:07:56Z")

</div>

Hi all,

I just joined the mailing list, so sorry if this topic was discussed before.

I would like to set the query size to infinite (or no limit).

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-from-size.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-from-size.html)  
This page explains what the parameters do, but there are no details on how  
to set the size to "no limit" or (if not possible) what is the max value  
accepted by ES for this parameter. I tried setting the value to -1, as I've  
read somewhere that this would be recognized as "no limit", but instead it  
defaults to 10.

Any help?

Thanks,  
Nuno

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/73ad3559-85b0-40a0-9325-5ff2054f192d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/73ad3559-85b0-40a0-9325-5ff2054f192d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [June 20, 2014, 9:25am UTC](https://discuss.elastic.co/t/how-to-set-the-query-resultset-size-to-infinite/18229/2 "2014-06-20T09:25:59Z")

</div>

You don't want to do that!  
If your need is to extract (download) 1 000 000 000 records, you need to use scan&scroll API: [http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/scan-scroll.html#scan-scroll](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/scan-scroll.html#scan-scroll)

--  
David Pilato | Technical Advocate | [Elasticsearch.com](http://Elasticsearch.com)  
@dadoonet | @elasticsearchfr

Le 20 juin 2014 à 11:08:00, Nuno Carvalho ([nunomrc@gmail.com](mailto:nunomrc@gmail.com)) a écrit:

Hi all,

I just joined the mailing list, so sorry if this topic was discussed before.

I would like to set the query size to infinite (or no limit).

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-from-size.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-from-size.html)  
This page explains what the parameters do, but there are no details on how to set the size to "no limit" or (if not possible) what is the max value accepted by ES for this parameter. I tried setting the value to -1, as I've read somewhere that this would be recognized as "no limit", but instead it defaults to 10.

Any help?

Thanks,  
Nuno

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/73ad3559-85b0-40a0-9325-5ff2054f192d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/73ad3559-85b0-40a0-9325-5ff2054f192d%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/etPan.53a3fe27.3352255a.198d%40MacBook-Air-de-David.local](https://groups.google.com/d/msgid/elasticsearch/etPan.53a3fe27.3352255a.198d%40MacBook-Air-de-David.local).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Nuno\_Carvalho](https://avatars.discourse-cdn.com/v4/letter/n/58956e/32.png) [@Nuno\_Carvalho](https://discuss.elastic.co/u/Nuno_Carvalho)
#### Post date: [June 20, 2014, 9:53am UTC](https://discuss.elastic.co/t/how-to-set-the-query-resultset-size-to-infinite/18229/3 "2014-06-20T09:53:35Z")

</div>

Right... that makes sense 🙂

I'll give it a try, thank you!

Nuno

On Friday, 20 June 2014 10:26:07 UTC+1, David Pilato wrote:

> You don't want to do that!  
> If your need is to extract (download) 1 000 000 000 records, you need to  
> use scan&scroll API:  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/guide/current/scan-scroll.html#scan-scroll)
> 
> --  
> _David Pilato_ | _Technical Advocate_ | _[Elasticsearch.com](http://Elasticsearch.com)_  
> @dadoonet [https://twitter.com/dadoonet](https://twitter.com/dadoonet) | @elasticsearchfr  
> [https://twitter.com/elasticsearchfr](https://twitter.com/elasticsearchfr)
> 
> Le 20 juin 2014 à 11:08:00, Nuno Carvalho ([nun...@gmail.com](mailto:nun...@gmail.com) \<javascript:\>)  
> a écrit:
> 
> Hi all,
> 
> I just joined the mailing list, so sorry if this topic was discussed  
> before.
> 
> I would like to set the query size to infinite (or no limit).
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-request-from-size.html)  
> This page explains what the parameters do, but there are no details on  
> how to set the size to "no limit" or (if not possible) what is the max  
> value accepted by ES for this parameter. I tried setting the value to -1,  
> as I've read somewhere that this would be recognized as "no limit", but  
> instead it defaults to 10.
> 
> Any help?
> 
> Thanks,  
> Nuno
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/73ad3559-85b0-40a0-9325-5ff2054f192d%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/73ad3559-85b0-40a0-9325-5ff2054f192d%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/73ad3559-85b0-40a0-9325-5ff2054f192d%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/73ad3559-85b0-40a0-9325-5ff2054f192d%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/49dbec8b-765a-4647-8672-b556028dcea0%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/49dbec8b-765a-4647-8672-b556028dcea0%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [July 6, 2017, 1:20am UTC](https://discuss.elastic.co/t/how-to-set-the-query-resultset-size-to-infinite/18229/4 "2017-07-06T01:20:57Z")

</div>


