es使用模板创建索引
es使⽤模板创建索引
创建模板:
PUT _template/metric_datatest
{
"index_patterns": ["metric_datatest-*"],
"order": 0,
"settings": {
"analysis": {
"analyzer": {
"tags_analyzer": {
"type": "pattern",
a股和b股的区别
"pattern": ","
}
骂女人的脏话}
}
},
"mappings": {
"properties": {
"ts": {
"type": "long"
},
"name": {
"type": "keyword"
},
"tags": {
"type": "text",
"analyzer": "tags_analyzer"
},
"count": {
"type": "long"
},
"sum": {
"type": "double"
},
"max": {
"type": "double"
},
"min": {
"type": "double"
}
怎样建博客}
},
"aliases": {
"metric_datatest": {}
朱丹被封杀
}
}
使⽤模板创建索引,不⽤指定mappings和settings:
PUT /metric_datatest-2021-04-16
插⼊需要指定具体的索引名,查询时只要使⽤别名metric_datatest就可以,可以并发查询别名对应的所有索引。
不使⽤模板创建索引
PUT /metric_data
{
"settings": {
"analysis": {
"analyzer": {
"tags_analyzer": {
"type": "pattern",
"pattern": ","
}
}
}
},
"mappings": {
"properties": {
"ts": {
"type": "long"
},
"name": {
"type": "keyword"
},
"tags": {
"type": "text",
"analyzer": "tags_analyzer"      },
"count": {
"type": "long"
},
"sum": {
"type": "double"
},
"max": {
"type": "double"
},
"min": {
"type": "double"
}
}
}
教师资格证报名流程}

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。