# How to increase the limit of ES return hits records

**URL:** <https://discuss.elastic.co/t/how-to-increase-the-limit-of-es-return-hits-records/154470>\
**Category:** Elasticsearch\
**Created:** [October 29, 2018, 4:40pm UTC](https://discuss.elastic.co/t/how-to-increase-the-limit-of-es-return-hits-records/154470 "2018-10-29T16:40:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![viphuangwei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viphuangwei/32/59306_2.png) [@viphuangwei](https://discuss.elastic.co/u/viphuangwei)\
**Post date:** [October 29, 2018, 4:40pm UTC](https://discuss.elastic.co/t/how-to-increase-the-limit-of-es-return-hits-records/154470/1 "2018-10-29T16:40:31Z")

</div>

Hi There,  
I am using \_xpack/sql/ to do the searching. By default the return records from ES it's 1000 per page.  
If there are millions of records need to be returned. Fetch 1000 records per time in this case it's not effective. it slow down the performance. is there any configuration that increase the return hits records limit?

Thank you.

---

<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:** [October 29, 2018, 4:52pm UTC](https://discuss.elastic.co/t/how-to-increase-the-limit-of-es-return-hits-records/154470/2 "2018-10-29T16:52:49Z")

</div>

The limit for from+page is actually 10000 by default.

You can increase this default value in the index settings (not recommended) or use instead scroll API or search\_after feature

---

<div class="post-metadata">

**Author:** ![viphuangwei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viphuangwei/32/59306_2.png) [@viphuangwei](https://discuss.elastic.co/u/viphuangwei)\
**Post date:** [October 29, 2018, 5:38pm UTC](https://discuss.elastic.co/t/how-to-increase-the-limit-of-es-return-hits-records/154470/3 "2018-10-29T17:38:34Z")

</div>

Hi David,

Thank you for your responding.  
I used ES SQL to do the searching:  
Post \_xpack/sql/  
{  
"query": "select column\_A from index\_A where query( 'super hero', 'type=phrase;default\_operator=OR')"  
}  
It only return 1000 records per page. Am i missing something here? which parameter i need to increase in order to increase the return hits.  
Is it 'max\_result\_window' ?

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [October 29, 2018, 6:13pm UTC](https://discuss.elastic.co/t/how-to-increase-the-limit-of-es-return-hits-records/154470/4 "2018-10-29T18:13:10Z")

</div>

You are missing the `cursor`. See [the docs](https://www.elastic.co/guide/en/elasticsearch/reference/6.x/sql-rest.html) for how to use it.

---

<div class="post-metadata">

**Author:** ![viphuangwei](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/viphuangwei/32/59306_2.png) [@viphuangwei](https://discuss.elastic.co/u/viphuangwei)\
**Post date:** [October 29, 2018, 8:34pm UTC](https://discuss.elastic.co/t/how-to-increase-the-limit-of-es-return-hits-records/154470/5 "2018-10-29T20:34:22Z")

</div>

Thank you very much Nik , From the link that you provided, There's a parameter "fetch\_size", This work.

---

<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:** [November 26, 2018, 8:34pm UTC](https://discuss.elastic.co/t/how-to-increase-the-limit-of-es-return-hits-records/154470/6 "2018-11-26T20:34:25Z")

</div>

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