# Elasticsearch reindex range

**URL:** <https://discuss.elastic.co/t/elasticsearch-reindex-range/227954>\
**Category:** Elasticsearch\
**Created:** [April 14, 2020, 3:36pm UTC](https://discuss.elastic.co/t/elasticsearch-reindex-range/227954 "2020-04-14T15:36:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammad\_Mousavi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohammad_mousavi/32/56508_2.png) [@Mohammad\_Mousavi](https://discuss.elastic.co/u/Mohammad_Mousavi)\
**Post date:** [April 14, 2020, 3:36pm UTC](https://discuss.elastic.co/t/elasticsearch-reindex-range/227954/1 "2020-04-14T15:36:44Z")

</div>

Hi, in my index template "clientip" field is text. so I need to reindex the indices.  
It's been about 2 months and indices are create every day:

> logstash-vod-2020.04.14  
> logstash-vod-2020.04.13

In docs I see I should use something like this:

> POST \_reindex  
> {  
> "source": {  
> "index": "twitter"  
> },  
> "dest": {  
> "index": "new\_twitter",  
> }  
> }

How can I write some loop or script that takes the dates and starts to reindex ?  
How can I change only "clientip" data type from text to ip ?  
It's my first time in ES reindex, I guess this "dest" index is kind of temp and I should change the name of it to what is was before. I mean logstash-vod-2020.04.14 will reindex to logstash-vod-2020.04.14\_new, logstash-vod-2020.04.14 will be deleted, logstash-vod-2020.04.14\_new will renamed to logstash-vod-2020.04.14. Am I right ?  
That was a long question, thank you so much 😅

---

<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:** [May 12, 2020, 3:44pm UTC](https://discuss.elastic.co/t/elasticsearch-reindex-range/227954/2 "2020-05-12T15:44:02Z")

</div>

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