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):
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.
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
):
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.
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):
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.
No, I do not believe you can make a template based on values in your data.
However, you can always parse your document first, and then decide what to
name your index, and then have index template match on the name that you
use.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.