##创建模板
curl -XPUT 'http://127.0.0.1:9200/_template/template_tlog_1' -d '
{
"template": "tlog-*",
"mappings": {
"_default_": {
"_all": { "enabled": false }
},
"tlog": {
"dynamic_templates": [
{ "strings": {
"match": "*",
"match_mapping_type": "string",
"mapping": {
"type": "string",
"index": "not_analyzed"
}
}}
]
}}
}
'
#删除模板
curl -XDELETE 'http://127.0.0.1:9200/_template/template_tlog_1'
#获取模板
curl -XGET 'http://127.0.0.1:9200/_template/template_tlog_1'
#获取索引index
curl -XGET 'http://127.0.0.1:9200/tlog-notAnalizy'
参考:
http://blog.csdn.net/dm_vincent/article/details/41593987
https://www.elastic.co/guide/en/elasticsearch/reference/current/dynamic-templates.html
http://blog.csdn.net/fisherman_hj/article/details/14164065
http://blog.csdn.net/zhanlanmg/article/details/50352338