将默认值设置为elasticsearch index.max_inner_result_window参数 [英] Set default value to elasticsearch index.max_inner_result_window parameter

查看:80
本文介绍了将默认值设置为elasticsearch index.max_inner_result_window参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我实际上正在使用Elasticsearch 6.7,但在ES中搜索时出现错误:

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

顶部匹配结果窗口太大,顶部匹配聚合器[实例]的+大小必须小于或等于:[100],但为[2147483647].可以通过更改[index.max_inner_result_window]索引级别设置来设置此限制.

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"
}

但是,elasticsearch不会更新将来将要创建的索引.

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

我的应用程序经常将文档放入新索引中.如果索引不存在,elasticsearch会创建它.但是,我不想每次将文档放入索引中时都运行此请求.

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.

问题是当文档放入内部时创建新索引时,该索引的默认值保持为100.

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.

es.yaml中有一个用于设置默认限制的参数,但是,它似乎已被弃用,无法正常工作.

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

我想要的是ES会在创建新索引时自动将限制设置为整数最大值,而无需每次将文档放入ES时都运行请求.

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.

关于,朱尔斯

推荐答案

您可以尝试在

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
            }
        }
    }
}

这篇关于将默认值设置为elasticsearch index.max_inner_result_window参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆