YuWatanabe
(Yu Watanabe)
August 3, 2016, 11:15am
1
Hi!
I am using logstash (ver 5.0.0 alpha 4) to insert data into elasticsearch.
I would like to know whether it is possible to apply different index template according to type name but in same index.
https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
So for example,
Logstash inserts documents as below types. All type has common fields and field types.
Index type fields and type
idx1 apple field : keyword
idx1 orange field : keyword
idx1 banana field : keyword
Is it possible to create different index templates?
drjz
(drjz)
August 3, 2016, 11:19am
2
YuWatanabe
(Yu Watanabe)
August 3, 2016, 11:26am
3
Hi !
Sorry I didnt make my explanation clear.
I was mentioning about index template.
https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html
johtani
(Jun Ohtani)
August 3, 2016, 12:09pm
4
There is no way, because index template is applied only at index creation time .
It is not related type name.
However you can create different index templates.
Multi index templates can be applied to one index.
https://www.elastic.co/guide/en/elasticsearch/reference/master/indices-templates.html#multiple-templates
Hello Jun-san.
What I thought was since you specify type , elasticsearch will also use the type for matching template.
I should have read definitive guide.
https://www.elastic.co/guide/en/elasticsearch/guide/2.x/mapping.html
I cannot have same field name with different type anyway.
warkolm
(Mark Walkom)
August 4, 2016, 8:11am
6