# Making index.max\_result\_window setting persistent

**URL:** <https://discuss.elastic.co/t/making-index-max-result-window-setting-persistent/63273>\
**Category:** Elasticsearch\
**Created:** [October 18, 2016, 9:25am UTC](https://discuss.elastic.co/t/making-index-max-result-window-setting-persistent/63273 "2016-10-18T09:25:08Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavang6](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pavang6](https://discuss.elastic.co/u/pavang6)\
**Post date:** [October 18, 2016, 9:25am UTC](https://discuss.elastic.co/t/making-index-max-result-window-setting-persistent/63273/1 "2016-10-18T09:25:08Z")

</div>

Is there a way to make index.max\_result\_window setting persistent.  
Also what are the available options to push this setting.

Thanks,  
Pavan

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [October 19, 2016, 12:44pm UTC](https://discuss.elastic.co/t/making-index-max-result-window-setting-persistent/63273/2 "2016-10-19T12:44:21Z")

</div>

Hi @pavang6,

you can use an [index template](https://www.elastic.co/guide/en/elasticsearch/reference/2.4/indices-templates.html) for this:

```auto
PUT /_template/my_global_template
{
  "template": "*",
  "order": 0,
  "settings": {
    "max_result_window": 20000
  }
}

```

By specifying this template, all indices that created afterwards will have this setting (but none of the preexisting ones).

Also be aware that you can run into memory problems if you increase `max_result_window` to a much higher value.

Daniel

---

<div class="post-metadata">

**Author:** ![pavang6](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pavang6](https://discuss.elastic.co/u/pavang6)\
**Post date:** [October 19, 2016, 1:00pm UTC](https://discuss.elastic.co/t/making-index-max-result-window-setting-persistent/63273/3 "2016-10-19T13:00:32Z")

</div>

Thank you Daniel.

Let say if i increase the count to 1000000 considering the extreme case which will never happen. Will that have an impact on memory even if all my search requests have size value less than 20000.

---

<div class="post-metadata">

**Author:** ![danielmitterdorfer](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielmitterdorfer/32/110510_2.png) [@danielmitterdorfer](https://discuss.elastic.co/u/danielmitterdorfer)\
**Post date:** [October 19, 2016, 1:11pm UTC](https://discuss.elastic.co/t/making-index-max-result-window-setting-persistent/63273/4 "2016-10-19T13:11:28Z")

</div>

Hi @pavang6,

it will only have an impact if you have an actual search request that really retrieves that many hits.

Daniel

---

<div class="post-metadata">

**Author:** ![pavang6](https://avatars.discourse-cdn.com/v4/letter/p/a6a055/32.png) [@pavang6](https://discuss.elastic.co/u/pavang6)\
**Post date:** [October 19, 2016, 1:12pm UTC](https://discuss.elastic.co/t/making-index-max-result-window-setting-persistent/63273/5 "2016-10-19T13:12:32Z")

</div>

Thanks very much !

Pavan

---

<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 5, 2017, 10:11pm UTC](https://discuss.elastic.co/t/making-index-max-result-window-setting-persistent/63273/6 "2017-07-05T22:11:15Z")

</div>


