1. Override default template(覆盖默认模板)

你可以在一个匹配所有索引的模板中,通过指定default类型映射来覆盖所有索引和所有类型的默认映射。

例如,要在所有新的索引中默认禁用所有类型的_all字段,你可以创建以下的索引模板:

PUT _template/disable_all_field
{
  "order": 0,
  "template": "*",              #1
  "mappings": {
    "_default_": {              #2
      "_all": {                 #3
        "enabled": false
      }
    }
  }}

| 1 | 将模式*匹配映射应用到一个index(索引),换句话说,就是应用到所有新的索引。 | | 2 | 在索引中定义default类型的映射。 | | 3 | 默认情况下禁用_all字段。 |

原文链接 : https://www.elastic.co/guide/en/elasticsearch/reference/5.3/override-default-template.html(修改该链接为官网对应的链接)

译文链接 : Override default template(覆盖默认模板)(修改该链接为 ApacheCN 对应的译文链接)

贡献者 : 曾少峰ApacheCNApache中文网

Copyright © Kilvn 2021. all right reserved,powered by Gitbook最后更新时间: 2021-06-08 20:22:42

results matching ""

    No results matching ""