# How to manage multiple indexes with spring data elasticsearch

**URL:** <https://discuss.elastic.co/t/how-to-manage-multiple-indexes-with-spring-data-elasticsearch/57440>\
**Category:** Elasticsearch\
**Created:** [August 8, 2016, 5:05am UTC](https://discuss.elastic.co/t/how-to-manage-multiple-indexes-with-spring-data-elasticsearch/57440 "2016-08-08T05:05:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sachin\_Shaju](https://avatars.discourse-cdn.com/v4/letter/s/e47c2d/32.png) [@Sachin\_Shaju](https://discuss.elastic.co/u/Sachin_Shaju)\
**Post date:** [August 8, 2016, 5:05am UTC](https://discuss.elastic.co/t/how-to-manage-multiple-indexes-with-spring-data-elasticsearch/57440/1 "2016-08-08T05:05:23Z")

</div>

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 ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:29pm UTC](https://discuss.elastic.co/t/how-to-manage-multiple-indexes-with-spring-data-elasticsearch/57440/2 "2017-07-05T22:29:31Z")

</div>


