Elasticsearch之静态模板

本文介绍了Elasticsearch的静态模板,包括其在索引创建时的应用,模板的增删改查操作,以及多模板匹配规则。通过设置order参数控制模板合并顺序,确保索引配置的正确性。同时,讨论了索引模板在业务繁忙时可能带来的数据堆积问题。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

一、index Template

这种模板也称之为静态模板,只能控制一些已知名字的字段,提前准备好索引的配置,待使用该类型的索引时,生成与索引模板配置相同的索引提供给用户使用。
Index templates allow you to define templates that will automatically be applied when new indices are created. The templates include both settings and mappings and a simple pattern template that controls whether the template should be applied to the new index.
索引模板允许您定义创建新索引时自动应用的模板。模板包括设置和映射以及一个简单的模式模板,用来控制模板是否应该应用到新的索引中。

Templates are only applied at index creation time. Changing a template will have no impact on existing indices. When using the create index API, the settings/mappings defined as part of the create index call will take precedence over any matching settings/mappings defined in the template.
模板仅在创建索引时应用。更改模板不会对现有索引产生影响。使用 create index API 时,作为创建索引调用一部分定义的设置/映射将优先于模板中定义的任何匹配设置/映射。

二、索引使用场景

由于一个索引已经满足不了业务场景,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值