# Configure index.max\_result\_window

**URL:** https://community.graylog.org/t/configure-index-max-result-window/9370
**Category:** Graylog Central (peer support)
**Created:** [March 11, 2019, 2:17pm UTC](https://community.graylog.org/t/configure-index-max-result-window/9370 "2019-03-11T14:17:30Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![BoKdo](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@BoKdo](https://community.graylog.org/u/BoKdo)
#### Post date: [March 11, 2019, 2:17pm UTC](https://community.graylog.org/t/configure-index-max-result-window/9370/1 "2019-03-11T14:17:30Z")

</div>

Hi,

I would like present graylog results in Microsoft Power BI.  
For that; I need a larger max\_result\_window than the default.  
I tried change the setting to elasticsearch.yml but with the new version of Elasticsearch it’s forbidden.

I found this topics;:

> [@Permanently configure index.max\_result\_window](https://community.graylog.org/t/permanently-configure-index-max-result-window/5733):
>
> Hi, We need a larger max\_result\_window than the default. I have successfully upped it for the current index, but when the index rolls, the setting is gone. I tried adding the setting to elasticsearch.yml but that didn’t work either. Looks like Graylog is using index templates. Can I modify the Graylog index template? If so, how would I do that? Thanks.

It seems that we need to work with graylog template…but I’m not an expert…so I a little bit lost.

Can someone help me please ?

---

<div class="post-metadata">

### Author: ![psargent](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/psargent/32/5559_2.png) [@psargent](https://community.graylog.org/u/psargent)
#### Post date: [March 11, 2019, 3:42pm UTC](https://community.graylog.org/t/configure-index-max-result-window/9370/2 "2019-03-11T15:42:00Z")

</div>

Hi, I followed this post which worked for me. [https://stackoverflow.com/questions/35206409/elasticsearch-2-1-result-window-is-too-large-index-max-result-window](https://stackoverflow.com/questions/35206409/elasticsearch-2-1-result-window-is-too-large-index-max-result-window) - essentially  
curl -XPUT “http://[server]:9200/\_settings” -d ‘{ “index” : { “max\_result\_window” : 50000 } }’

---

<div class="post-metadata">

### Author: ![BoKdo](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@BoKdo](https://community.graylog.org/u/BoKdo)
#### Post date: [March 11, 2019, 4:31pm UTC](https://community.graylog.org/t/configure-index-max-result-window/9370/3 "2019-03-11T16:31:59Z")

</div>

Hello,

Thanks for the reply.  
I run:  
curl -XPUT ‘[http://xx.xx.xx.x:9200/\_settings](http://xx.xx.xx.x:9200/_settings)’ -d ‘{ “index” : { “max\_result\_window” : 5000000 } }’ ==\> {“acknowledged”:true}

So…from REST API browser / Search/Relative : Message search ; I put my request : query: 307 ; range: 2592000 ; Limit : 5000000.

==\> Response Body:

# Internal Server Error

## Reason

java.lang.OutOfMemoryError: Java heap space

* * *

Too more results ?  
For information; when I run this search in the Web interface, I have got :  
“186,219 messages in 48 ms, searched in 3 indices”

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [March 12, 2019, 6:49am UTC](https://community.graylog.org/t/configure-index-max-result-window/9370/4 "2019-03-12T06:49:57Z")

</div>

the result does not fit into the Heap - e.g. you can’t query that much at once.

---

<div class="post-metadata">

### Author: ![BoKdo](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@BoKdo](https://community.graylog.org/u/BoKdo)
#### Post date: [March 12, 2019, 12:12pm UTC](https://community.graylog.org/t/configure-index-max-result-window/9370/5 "2019-03-12T12:12:23Z")

</div>

Hello Jan,

Thanks for the answer.

What can you advise me?

I put the context:  
Graylog is used to log and count all print job of print servers.  
We would like use Power BI to visualise and analyse all print logs from Graylog.  
Requests from Power BI by API work; but on a small time slot.  
Requests for month gives me the previous error.

I read “Scroll” or “Search After” can maybe help me.  
Do you know this API ?  
Have you already use them ?

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [March 12, 2019, 12:26pm UTC](https://community.graylog.org/t/configure-index-max-result-window/9370/6 "2019-03-12T12:26:57Z")

</div>

yes, Graylog use them.

Did you query the Graylog API or the Elasticsearch API?

---

<div class="post-metadata">

### Author: ![BoKdo](https://avatars.discourse-cdn.com/v4/letter/b/7feea3/32.png) [@BoKdo](https://community.graylog.org/u/BoKdo)
#### Post date: [March 12, 2019, 2:55pm UTC](https://community.graylog.org/t/configure-index-max-result-window/9370/7 "2019-03-12T14:55:55Z")

</div>

I use the Graylog REST API browser:  
[http://x.x.x.x:9000/api/search/universal/relative?query=307&range=3600&limit=5000000&decorate=true](http://x.x.x.x:9000/api/search/universal/relative?query=307&range=3600&limit=5000000&decorate=true)

How Can I use the Elasticsearch API ?

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)
#### Post date: [March 26, 2019, 4:03pm UTC](https://community.graylog.org/t/configure-index-max-result-window/9370/8 "2019-03-26T16:03:12Z")

</div>

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