Set default value to elasticsearch index.max_inner_result_window parameter

喜你入骨 提交于 2021-01-29 18:11:40

问题


I'm actually using elasticsearch 6.7 and I get an error while searching in ES :

Top hits result window is too large, the top hits aggregator [instances]'s from + size must be less than or equal to: [100] but was [2147483647]. This limit can be set by changing the [index.max_inner_result_window] index level setting.

I know how to change this parameter, this is not the issue.

I actually use this to change the parameter on existing indexes:

PUT _all/_settings
{
  "index.max_inner_result_window": "2147483647"
}

However, elasticsearch will not update future indexes that will be created.

My app often put documents in new indexes. If the index doesn't exist, elasticsearch creates it. However I don't want to run this request everytime a document is put inside an index.

The issue is when a new index is created when a document is put inside, it keep the default value to 100 for this index.

There is a paramter in es.yaml to set the default limit, however, it seems to be deprecated and not working.

What I want is that ES set automatically the limit to the integer max value when a new index is created without running the request each time I put a document in ES.

Thank you for reading, hope you can help me.

Regards, Jules


回答1:


Can you try defining this in the index template like below so that all the new index created will have this setting.

{
    "index_patterns": [
        "*" // note this
    ],
    "template": {
        "settings": {
            "index":{
                "max_inner_result_window": 2147483647
            }
        }
    }
}


来源:https://stackoverflow.com/questions/62579275/set-default-value-to-elasticsearch-index-max-inner-result-window-parameter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!