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]
|
[source,js]
|
||||||
--------------------------------------------------
|
--------------------------------------------------
|
||||||
curl -XPUT localhost:9200/_template/template_1 -d '
|
PUT /_template/template_1
|
||||||
{
|
{
|
||||||
"template" : "te*",
|
"template": "te*",
|
||||||
"settings" : {
|
"settings": {
|
||||||
"number_of_shards" : 1
|
"number_of_shards": 1
|
||||||
},
|
},
|
||||||
"mappings" : {
|
"mappings": {
|
||||||
"type1" : {
|
"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*`.
|
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
|
The settings and mappings will be applied to any index name that matches
|
||||||
|
|
Loading…
Reference in New Issue