If you find yourself repeatedly creating indexes with some similar
characteristics, then you create an index template. Whenever you create a
new index and if a template exists that matches it, then the template will
be applied along with whatever you have predefined inside the template. An
example is below (taken directly from the docs -
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-templates.html#multiple-templates):
curl -XPUT localhost:9200/_template/template_1 -d '
{
"template" : "te*",
"settings" : {
"number_of_shards" : 1
},
"mappings" : {
"type1" : {
"_source" : { "enabled" : false }
}
}
}
'
The above template says, if anybody creates a new index in the future with
a name that starts with te ("te*"), then automatically make 1 shard for it,
and disable the _source field.
--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/498f5a74-4b0f-44a3-b88c-87f2a2b8b07f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.