# How to increase the default size limit from 10000 to 1000000 in ElasticSearch

**URL:** <https://discuss.elastic.co/t/how-to-increase-the-default-size-limit-from-10000-to-1000000-in-elasticsearch/208807>\
**Category:** Elasticsearch\
**Created:** [November 21, 2019, 5:07am UTC](https://discuss.elastic.co/t/how-to-increase-the-default-size-limit-from-10000-to-1000000-in-elasticsearch/208807 "2019-11-21T05:07:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![chandu506](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@chandu506](https://discuss.elastic.co/u/chandu506)\
**Post date:** [November 21, 2019, 5:07am UTC](https://discuss.elastic.co/t/how-to-increase-the-default-size-limit-from-10000-to-1000000-in-elasticsearch/208807/1 "2019-11-21T05:07:08Z")

</div>

How to increase the default size limit from 10000 to 1000000 in ElasticSearch

---

<div class="post-metadata">

**Author:** ![somnath.guthula](https://avatars.discourse-cdn.com/v4/letter/s/b38774/32.png) [@somnath.guthula](https://discuss.elastic.co/u/somnath.guthula)\
**Post date:** [November 21, 2019, 5:29am UTC](https://discuss.elastic.co/t/how-to-increase-the-default-size-limit-from-10000-to-1000000-in-elasticsearch/208807/2 "2019-11-21T05:29:12Z")

</div>

Hi @chandu506 ,

Why don't you explore the scroll API?

[https://www.elastic.co/guide/en/elasticsearch/reference/7.4/search-request-body.html#request-body-search-scroll](https://www.elastic.co/guide/en/elasticsearch/reference/7.4/search-request-body.html#request-body-search-scroll)

There are ways to increase to the default size limit. However, That is not recommended. An efficient way would be to use the scroll API and fetch the records page by page.

Hope that helps. Thanks.

Regards,  
Somnath

---

<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:** [November 21, 2019, 8:33am UTC](https://discuss.elastic.co/t/how-to-increase-the-default-size-limit-from-10000-to-1000000-in-elasticsearch/208807/3 "2019-11-21T08:33:07Z")

</div>

Welcome!

You can change `index.max_result_window` but you need to be careful when doing so as mentioned @somnath.guthula .

See documentation: [https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html)

---

<div class="post-metadata">

**Author:** ![chandu506](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@chandu506](https://discuss.elastic.co/u/chandu506)\
**Post date:** [November 22, 2019, 4:32am UTC](https://discuss.elastic.co/t/how-to-increase-the-default-size-limit-from-10000-to-1000000-in-elasticsearch/208807/4 "2019-11-22T04:32:57Z")

</div>

Hi Somnath,

Thank you very much for your response.

Yes, I do agree with you comments and I have done the pagination on the web application, but we have a requirement where we pull certain amount of records like 1Million from ElasticSearch and send that data as an attachment in the email. So, in that case, I won't be able to do the pagination right, that's the reason why I had to increase the default max limit.

So, say if I increase the limit, will that impact all the searches even though we are use the pagination like from=&size=

Hope you understood my problem.

Thanks.  
Chandra

---

<div class="post-metadata">

**Author:** ![chandu506](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@chandu506](https://discuss.elastic.co/u/chandu506)\
**Post date:** [November 22, 2019, 4:33am UTC](https://discuss.elastic.co/t/how-to-increase-the-default-size-limit-from-10000-to-1000000-in-elasticsearch/208807/5 "2019-11-22T04:33:38Z")

</div>

Hi David,

Thank you very much for your response.

Yes, I do agree with you comments and I have done the pagination on the web application, but we have a requirement where we pull certain amount of records like 1Million from ElasticSearch and send that data as an attachment in the email. So, in that case, I won't be able to do the pagination right, that's the reason why I had to increase the default max limit.

So, say if I increase the limit, will that impact all the searches even though we are use the pagination like from=&size=

Hope you understood my problem.

Thanks.  
Chandra

---

<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:** [November 22, 2019, 1:25pm UTC](https://discuss.elastic.co/t/how-to-increase-the-default-size-limit-from-10000-to-1000000-in-elasticsearch/208807/6 "2019-11-22T13:25:22Z")

</div>

To extract data for further processing (here as an attachment), you need to use the `_scroll` API.

---

<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:** [December 20, 2019, 1:25pm UTC](https://discuss.elastic.co/t/how-to-increase-the-default-size-limit-from-10000-to-1000000-in-elasticsearch/208807/7 "2019-12-20T13:25:22Z")

</div>

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