定义模板:
curl -XPUT localhost:9200/_template/xxxtemplate -d '
{
"template" : "ehl*",
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"type1" : {
"_source" : {"enabled" : false }
}
}
}
'
上述定义的模板xxxtemplate将对用ehl开头的新索引都是有效。
删除模板:
curl -XDELETE localhost:9200/_template/xxxtemplate
查看模板:
curl -XGET localhost:9200/_template/xxxtemplate