# Max\_result\_window

**URL:** https://discuss.elastic.co/t/max-result-window/90463
**Category:** Elasticsearch
**Created:** [June 22, 2017, 1:26pm UTC](https://discuss.elastic.co/t/max-result-window/90463 "2017-06-22T13:26:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Alex\_Davidovich](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Alex\_Davidovich](https://discuss.elastic.co/u/Alex_Davidovich)
#### Post date: [June 22, 2017, 1:26pm UTC](https://discuss.elastic.co/t/max-result-window/90463/1 "2017-06-22T13:26:35Z")

</div>

I have a problem where in some rare cases I am asked to bring results with parameters  
"from":"10000", "size":"1000".  
Of course, it fails on max\_result\_window.  
Unfortunately, the "from" also could be much bigger...  
Should I run a while loop in the server with scroll? any other way?  
The sorting is also different between different requests so search after is not an option.

---

<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 22, 2017, 2:24pm UTC](https://discuss.elastic.co/t/max-result-window/90463/2 "2017-06-22T14:24:24Z")

</div>

You can change `index.max_result_window` index setting as well.

See [https://www.elastic.co/guide/en/elasticsearch/reference/5.4/index-modules.html#dynamic-index-settings](https://www.elastic.co/guide/en/elasticsearch/reference/5.4/index-modules.html#dynamic-index-settings)

---

<div class="post-metadata">

### Author: ![Alex\_Davidovich](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Alex\_Davidovich](https://discuss.elastic.co/u/Alex_Davidovich)
#### Post date: [June 22, 2017, 2:37pm UTC](https://discuss.elastic.co/t/max-result-window/90463/3 "2017-06-22T14:37:14Z")

</div>

Thanks, I was aware of that.  
Though it could be dangerous, am I wrong?

---

<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 22, 2017, 2:42pm UTC](https://discuss.elastic.co/t/max-result-window/90463/4 "2017-06-22T14:42:06Z")

</div>

> Though it could be dangerous, am I wrong?

Well. If you increase to 10001, not really.  
If you increase to 10000000, probably. In term of memory...

---

<div class="post-metadata">

### Author: ![Alex\_Davidovich](https://avatars.discourse-cdn.com/v4/letter/a/b9e5f3/32.png) [@Alex\_Davidovich](https://discuss.elastic.co/u/Alex_Davidovich)
#### Post date: [June 25, 2017, 7:45am UTC](https://discuss.elastic.co/t/max-result-window/90463/5 "2017-06-25T07:45:36Z")

</div>

I have only 1 shard and 2 replicas. This should make ES life easier while deep paging, right?

---

<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 25, 2017, 8:06am UTC](https://discuss.elastic.co/t/max-result-window/90463/6 "2017-06-25T08:06:58Z")

</div>

Probably less things to keep in memory because you have only one shard.

Try with many users, and monitor your HEAP usage.

---

<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 23, 2017, 8:07am UTC](https://discuss.elastic.co/t/max-result-window/90463/7 "2017-07-23T08:07:11Z")

</div>

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