# \[spring-data-elasticsearch\] how to dynamically assign index by argument column value

**URL:** <https://discuss.elastic.co/t/spring-data-elasticsearch-how-to-dynamically-assign-index-by-argument-column-value/328594>\
**Category:** Elasticsearch\
**Created:** [March 27, 2023, 9:20am UTC](https://discuss.elastic.co/t/spring-data-elasticsearch-how-to-dynamically-assign-index-by-argument-column-value/328594 "2023-03-27T09:20:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dan\_kim](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dan_kim/32/95741_2.png) [@dan\_kim](https://discuss.elastic.co/u/dan_kim)\
**Post date:** [March 27, 2023, 9:20am UTC](https://discuss.elastic.co/t/spring-data-elasticsearch-how-to-dynamically-assign-index-by-argument-column-value/328594/1 "2023-03-27T09:20:41Z")

</div>

Hello I'm trying to save transactional data of product on elasticsearch  
and building spring boot as data-pipe line server .

there are lots of index with same column like CategoryA\_Trasaction and CategoryB\_Transaction....  
which can be represented as Child class of Transaction class

in this case, Is there a way that using one document Class and repository class to Read and write multiple indexes?

* * *

I think it can be achieved by "Elasticsearch-high-level-client" but it will be deprecated soon,  
so i want to find other way

---

<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:** [April 24, 2023, 9:21am UTC](https://discuss.elastic.co/t/spring-data-elasticsearch-how-to-dynamically-assign-index-by-argument-column-value/328594/2 "2023-04-24T09:21:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
