Index Template和Dynamic Template

什么是Index Template

Index Template - 帮助你设定Mappings 和 Settings,并按照一定的规则,自动匹配到新创建的索引之上
模板仅在一个索引被新创建时,才会产生作用。修改模板不会影响到自己创建的索引
可以设定多个模板,这些设置会被"merge"在一起
可以指定"order"的数值,控制"mergine"的过程

Index Template的工作方式

当一个索引被新创建时
应用Elasticsearch默认的settings和mappings
应用order数值低的Index Template中的设定
应用order高的Index Template中的设定,之前的设定会被覆盖
应用创建索引时,用户所指定的Settings和Mappings,并覆盖之前模板中的设定

猜你喜欢

转载自www.cnblogs.com/anyux/p/11960697.html