Change Elasticsearch settings without Kibana

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?

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

You can use:

  • the size and from parameters 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 feature to do deep pagination.
  • the Scroll API if you want to extract a resultset to be consumed by another tool later. (Not recommended anymore)
1 Like

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 ‘:’

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.

I was trying this:

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.

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

May be try with: index.max_result_window

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