elasticsearch total_fields.limit作为全局

时间:2018-12-17 07:56:14

标签: elasticsearch

我有大型文档(每个文档中有1000多个字段),因此我需要设置 index.mapping.total_fields.limit = 9000 对于我的每个索引,

我可以为所有索引设置全局配置并更改其默认限制吗? 我正在使用elasticsearch js库,(但我也可以使用API​​)

谢谢, 拉里

1 个答案:

答案 0 :(得分:1)

您可以做的是使用index template,该https://www.highcharts.com/demo/histogram将在创建时应用于所有索引:

PUT _template/common-template
{
  "index_patterns": "*",                    <--- applies to all indices
  "order": 10,                              <--- high order to apply the template last
  "settings": {
    "index": {
      "mapping": {
        "total_fields": {
          "limit": "9000"                   <--- this setting will apply to all indices
        }
      }
    }
  },
  "aliases": {},
  "mappings": {
     ... common mappings go here...
  }
}