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):

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, 
create a type named type1, and disable its _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/23313c6a-ac12-49a1-aa57-23e6be854ee1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to