1、创建\更新索引模板
PUT _template/logging_template
{
"index_patterns": [
"logging-*" // 可以通过"my*"和"index*"来适配, template字段已过期
],
"order": 0, // 模板的权重, 多个模板的时候优先匹配用, 值越大, 权重越高
"settings": {
"number_of_shards": 1, // 分片数量, 可以定义其他配置项
"number_of_replicas": "1" // 副本数
},
"aliases": {
"alias_1": {} // 索引对应的别名
},
"mappings": {
"properties": {
"ad_id": {
"type": "long"
}
}
}
}
2、删除索引模板
DELETE _template/logging_template
3、查询索引模板
GET _template/logging_template