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

相关内容

热门资讯

晋拓股份跌6.21%,成交额1... 7月28日,晋拓股份跌6.21%,成交额1.48亿元,换手率2.27%,总市值63.60亿元。异动分...
鸿铭股份涨5.09%,成交额2... 7月28日,鸿铭股份涨5.09%,成交额2157.17万元,换手率2.56%,总市值21.68亿元。...
咸亨国际涨0.00%,成交额6... 7月28日,咸亨国际涨0.00%,成交额6845.52万元,换手率1.28%,总市值53.79亿元。...
奥普特跌6.78%,成交额2.... 7月28日,奥普特跌6.78%,成交额2.93亿元,换手率2.19%,总市值130.47亿元。异动分...
凯盛新材跌0.06%,成交额8... 7月28日,凯盛新材跌0.06%,成交额8883.47万元,换手率1.31%,总市值71.56亿元。...