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:
parent
c5bbb023fa
commit
20b398daea
|
@ -13,20 +13,31 @@ For example:
|
|||
|
||||
[source,js]
|
||||
--------------------------------------------------
|
||||
curl -XPUT localhost:9200/_template/template_1 -d '
|
||||
PUT /_template/template_1
|
||||
{
|
||||
"template" : "te*",
|
||||
"settings" : {
|
||||
"number_of_shards" : 1
|
||||
"template": "te*",
|
||||
"settings": {
|
||||
"number_of_shards": 1
|
||||
},
|
||||
"mappings" : {
|
||||
"type1" : {
|
||||
"_source" : { "enabled" : false }
|
||||
"mappings": {
|
||||
"type1": {
|
||||
"_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
|
||||
|
|
Loading…
Reference in New Issue