# Which is more efficient, to reindex the raw .ndjson or use the \_reindex api

**URL:** <https://discuss.elastic.co/t/which-is-more-efficient-to-reindex-the-raw-ndjson-or-use-the-reindex-api/222911>\
**Category:** Elasticsearch\
**Created:** [March 10, 2020, 10:18am UTC](https://discuss.elastic.co/t/which-is-more-efficient-to-reindex-the-raw-ndjson-or-use-the-reindex-api/222911 "2020-03-10T10:18:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Norman\_Khine](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/norman_khine/32/3342_2.png) [@Norman\_Khine](https://discuss.elastic.co/u/Norman_Khine)\
**Post date:** [March 10, 2020, 10:18am UTC](https://discuss.elastic.co/t/which-is-more-efficient-to-reindex-the-raw-ndjson-or-use-the-reindex-api/222911/1 "2020-03-10T10:18:07Z")

</div>

Hello,  
Currently we backup our daily indexes to AWS S3 as raw .ndjosn format and I wanted an opinion whether it would be better to re-ingest these files into a monthly index or use the `_reindex` API to this.

So my options would be:

- to get all the indexes that have last months dates, load into Firehose and then ingest into `index-YYYY.MM` index

- use the reindex API like:

```auto
POST _reindex?requests_per_second=115&wait_for_completion=true
{
  "source": {
    "index": "index-YYYY.MM.*",
    "size": 1000
  },
  "dest": {
    "index": "index-YYYY.MM"
  },
  "conflicts": "proceed", 
  "script": {
    "lang": "painless",   
    "source": """
      ctx._source.index = ctx._index;
    """
  }
}

```

apart from complexity, additional moving parts and data transfer is there any value to using the first option?

any advice is much appreciated

---

<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:** [March 10, 2020, 1:19pm UTC](https://discuss.elastic.co/t/which-is-more-efficient-to-reindex-the-raw-ndjson-or-use-the-reindex-api/222911/2 "2020-03-10T13:19:26Z")

</div>

Hey,

from my perspective reindex sounds good. The only difference is (leaving complexity of having a loader component aside), that with reindex you will a slightly higher load on the Elasticsearch due to retrieving those documents before indexing them again, doing both steps (loading and indexing) on the ES cluster side.

Not a deal breaker from my perspective though.

--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:** [April 7, 2020, 1:19pm UTC](https://discuss.elastic.co/t/which-is-more-efficient-to-reindex-the-raw-ndjson-or-use-the-reindex-api/222911/3 "2020-04-07T13:19:29Z")

</div>

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