创建动态模版:
curl -PUT http://ip:9200/_template/模版名称
{
"index_patterns": [
"*"
],
"order": 0,
"version": 1,
"mappings": {
"dynamic_templates": [
{
"string_fields": {
"match": "*Text",
"mapping": {
"type": "text",
"analyzer": "ik_max_word",
"fields": {
"keyword": {
"type": "keyword"
}
}
}
}
},
{
"nested_fields": {
"match": "*_nested",
"mapping": {
"type": "nested"
}
}
}
]
}
}
查询模版:
curl -GET http://ip:9200/_template/模版名称