Add a more descriptive example to Index Template

Closes #17513
The current example in the documentation for Index Templates lacks any properties values. This is helpful to many devs that aren't sure how to take a regular Index Mapping and convert it to a template.
This commit is contained in:
Mahmoud Lababidi 2016-04-04 13:29:07 -04:00 committed by Clinton Gormley
parent c5bbb023fa
commit 20b398daea
1 changed files with 21 additions and 10 deletions

View File

@ -13,7 +13,7 @@ For example:
[source,js]
--------------------------------------------------
curl -XPUT localhost:9200/_template/template_1 -d '
PUT /_template/template_1
{
"template": "te*",
"settings": {
@ -21,12 +21,23 @@ curl -XPUT localhost:9200/_template/template_1 -d '
},
"mappings": {
"type1": {
"_source" : { "enabled" : false }
"_source": {
"enabled": false
},
"properties": {
"host_name": {
"type": "keyword"
},
"created_at": {
"type": "date",
"format": "EEE MMM dd HH:mm:ss Z YYYY"
}
}
}
}
}
'
--------------------------------------------------
// AUTOSENSE
Defines a template named template_1, with a template pattern of `te*`.
The settings and mappings will be applied to any index name that matches