# Elasticsearch Reindex using script

**URL:** <https://discuss.elastic.co/t/elasticsearch-reindex-using-script/107098>\
**Category:** Elasticsearch\
**Created:** [November 9, 2017, 8:01pm UTC](https://discuss.elastic.co/t/elasticsearch-reindex-using-script/107098 "2017-11-09T20:01:27Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sreejithps303](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sreejithps303/32/23868_2.png) [@sreejithps303](https://discuss.elastic.co/u/sreejithps303)\
**Post date:** [November 9, 2017, 8:01pm UTC](https://discuss.elastic.co/t/elasticsearch-reindex-using-script/107098/1 "2017-11-09T20:01:27Z")

</div>

Hi ,

I want to reindex my old index by adding two new fields depends on a existing field . I have a csv like below.

exisitingfeild,newfeild1,newfiled2

Can we use the reindex API's script field to parse this csv and renidex ?

Can any one help?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 10, 2017, 9:47am UTC](https://discuss.elastic.co/t/elasticsearch-reindex-using-script/107098/2 "2017-11-10T09:47:25Z")

</div>

Hey,

the reindex API is not able to read anything from disk, you would need to supply this information externally. From what I read I think it makes more sense to implement your own python/perl/shell script using a scroll search, that is also reading that CSV.

--Alex

---

<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:** [December 8, 2017, 9:47am UTC](https://discuss.elastic.co/t/elasticsearch-reindex-using-script/107098/3 "2017-12-08T09:47:27Z")

</div>

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