Elasticsearch 索引模板
创始人
2024-05-19 15:34:33

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

相关内容

热门资讯

3月30日中证A500ETF泰... 3月30日,中证A500ETF泰康(560510)跌0.09%,成交额5038.93万元。当日份额增...
3月30日A500ETF易方达... 3月30日,A500ETF易方达(159361)跌0.17%,成交额23.32亿元。当日份额减少2....
3月30日电网设备ETF国泰(... 3月30日,电网设备ETF国泰(561380)涨0.65%,成交额1.42亿元。当日份额增加300....
3月30日上证180ETF华泰... 3月30日,上证180ETF华泰柏瑞(530300)跌0.25%,成交额1021.04万元。当日份额...
3月30日A500ETF中金(... 3月30日,A500ETF中金(512080)跌0.08%,成交额4971.10万元。当日份额增加1...