创建索引模板:所有以fmmall和bar开头的索引将使用如下的模板创建索引
PUT _template/template_1?order=0 { "index_patterns": [ "fmmall*", "bar*" ], "settings": { "number_of_shards": 1 }, "order": 0, "mappings": { "properties": { "productId": { "type": "long" }, "productName": { "type": "text" }, "productsImg": { "type": "text", "fields": { "keyword": { "type": "keyword", "ignore_above": 256 } } }, "productSku4Es": { "type": "nested", "properties": { "skuId": { "type": "long" }, "skuName": { "type": "text" }, "sellPrice": { "type": "float" } } } } } }