How to manage multiple indexes with spring data elasticsearch

In spring data elasticsearch one model class/entity represents or maps to an index and type.

eg :-

@Document(indexName = "myindex",type="mytype")
public class DocumentModel {
    ......
} 

I have a use case in which I should index data in different es indexes with same structure. If that's the case how can I represent all of those indices with this model class ?

1 Like