How to apply different index template in single index?


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.

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?

You can define multiple search types for a single index, see

Hi !

Sorry I didnt make my explanation clear.

I was mentioning about index template.

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.

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.

I cannot have same field name with different type anyway.

Be careful of this -


Thank you for the reply.

I will look into it.