我应该在哪里配置 max_result_window 索引设置?

2024-03-02

我正在尝试添加到我的elasticsearch.yml

index.max_result_window: 10000

但问题是它不喜欢我添加index.在配置中(它会导致错误),这在elastica版本2.X中工作,但现在在6.X中似乎不起作用。知道如何在最新的 Elastica 版本中配置索引吗?我似乎无法找到这个问题的答案。


The max_result_window是动态索引级别设置,不是特定于节点的。默认值为 10,000,因此如果您想要设置该值,则无需设置。

您可以通过更新特定索引设置或全局更新所有索引设置来调整它existing指数:

PUT _settings
{
  "index.max_result_window": 11000
}

以上将更新所有existing指数。为了使其对未来的指数生效,您需要一个针对特定索引模式的索引模板(或仅 * 表示全局) - 例如:

PUT _template/example
{
  "index_patterns": ["settings_test*"],
  "settings": {
    "index.max_result_window": 12000
  }
}

PUT settings_test

上面将产生以下结果:

GET settings_test
...

{
  "settings_test" : {
    "aliases" : { },
    "mappings" : { },
    "settings" : {
      "index" : {
        ...
        "max_result_window" : "12000",
        ...
      }
    }
  }
}

Ref: https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html https://www.elastic.co/guide/en/elasticsearch/reference/current/index-modules.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

我应该在哪里配置 max_result_window 索引设置? 的相关文章

随机推荐