# Change Elasticsearch settings without Kibana

**URL:** <https://discuss.elastic.co/t/change-elasticsearch-settings-without-kibana/301681>\
**Category:** Elasticsearch\
**Created:** [April 5, 2022, 10:25pm UTC](https://discuss.elastic.co/t/change-elasticsearch-settings-without-kibana/301681 "2022-04-05T22:25:05Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![carl25en](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carl25en/32/99840_2.png) [@carl25en](https://discuss.elastic.co/u/carl25en)\
**Post date:** [April 5, 2022, 10:25pm UTC](https://discuss.elastic.co/t/change-elasticsearch-settings-without-kibana/301681/1 "2022-04-05T22:25:05Z")

</div>

Hey there!

I was wondering if there is any way to change the settings of Elasticsearch without using Kibana. I specifically have to change the size of the result of query from 10,000 (default) to 120,000. Is it possible to do it by adding something to the python code? Or maybe by modifying the Yml file?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [April 5, 2022, 10:26pm UTC](https://discuss.elastic.co/t/change-elasticsearch-settings-without-kibana/301681/2 "2022-04-05T22:26:23Z")

</div>

The size parameter of a query is defined in the query itself, can you not change it there?

---

<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:** [April 5, 2022, 11:30pm UTC](https://discuss.elastic.co/t/change-elasticsearch-settings-without-kibana/301681/3 "2022-04-05T23:30:24Z")

</div>

You can use:

- the [`size` and `from` parameters](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-from-size.html) to display by default up to 10000 records to your users. If you want to change this limit, you can change `index.max_result_window` setting but be aware of the consequences (ie memory).
- the [search after](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-search-after.html) feature to do deep pagination.
- the [Scroll API](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html) if you want to extract a resultset to be consumed by another tool later. (Not recommended anymore)

---

<div class="post-metadata">

**Author:** ![carl25en](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carl25en/32/99840_2.png) [@carl25en](https://discuss.elastic.co/u/carl25en)\
**Post date:** [April 6, 2022, 4:19am UTC](https://discuss.elastic.co/t/change-elasticsearch-settings-without-kibana/301681/4 "2022-04-06T04:19:00Z")

</div>

And how can I add (where) index.max\_result\_window:120000 to my code?

If I try to add it to my yml file then I get the error saying: could not find expected ‘:’

---

<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:** [April 6, 2022, 4:56am UTC](https://discuss.elastic.co/t/change-elasticsearch-settings-without-kibana/301681/5 "2022-04-06T04:56:01Z")

</div>

It's something to add to the index settings, when you create the index or by calling the index update settings API.

But please understand the consequences of changing such a setting.

---

<div class="post-metadata">

**Author:** ![carl25en](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/carl25en/32/99840_2.png) [@carl25en](https://discuss.elastic.co/u/carl25en)\
**Post date:** [April 6, 2022, 5:19am UTC](https://discuss.elastic.co/t/change-elasticsearch-settings-without-kibana/301681/6 "2022-04-06T05:19:35Z")

</div>

I was trying this:

```auto
test={
    "settings": {
        "max_result_window" : 1000000
    }
}
# #
es.indices.create(index='distances10', ignore=400, settings=test)

```

But it does not seem to work. Any idea?  
Thank you for your concern, I understand the consequences of this setting.

---

<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:** [April 6, 2022, 5:42am UTC](https://discuss.elastic.co/t/change-elasticsearch-settings-without-kibana/301681/7 "2022-04-06T05:42:21Z")

</div>

> [@carl25en](#):
>
> But it does not seem to work.

What does this mean? An error message? Anything else?

May be try with: `index.max_result_window`

---

<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:** [May 4, 2022, 5:42am UTC](https://discuss.elastic.co/t/change-elasticsearch-settings-without-kibana/301681/8 "2022-05-04T05:42:44Z")

</div>

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