# Timeout issue when using reindex API

**URL:** https://discuss.elastic.co/t/timeout-issue-when-using-reindex-api/210484
**Category:** Elasticsearch
**Created:** [December 4, 2019, 7:44am UTC](https://discuss.elastic.co/t/timeout-issue-when-using-reindex-api/210484 "2019-12-04T07:44:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ymin1103](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ymin1103/32/58797_2.png) [@ymin1103](https://discuss.elastic.co/u/ymin1103)
#### Post date: [December 4, 2019, 7:44am UTC](https://discuss.elastic.co/t/timeout-issue-when-using-reindex-api/210484/1 "2019-12-04T07:44:49Z")

</div>

Hello. I am using elasticsearch and kibana with version 7.5.0 now.  
My cluster consists of 1 master node, 2 data nodes and 1 coordi node.  
I tried to reindex an index with about 200k documents to a new index within the cluster using \_reindex API.  
However, all documents are not indexed properly. When number of docs reindexed reaches request's batch size, reindexing suddenly stops and nothing happens.

```json
POST _reindex?wait_for_completion=false
{
  "source": {
    "index": "old_index",
    "size": 10000
  },
  "dest": {
    "index": "new_index"
  },
  "script": {
    "source": 
    """
      ctx._source.new_field1 = ctx._source.remove("old_field1");
      ctx._source.new_field2 = ctx._source.remove("old_field2")
    """
  }
}

```

Above is the request I sent. In this case, only 10k docs are reindexed.

```json
{
  "index": "new_index",
  "type": "_doc",
  "id": {{docs_id}},
  "cause": {
    "type": "mapper_exception",
    "reason": "timed out while waiting for a dynamic mapping update"
  },
  "status": 500
}

```

Above is the failure object of the task(reindexing).

I googled about it few hours but I can not figure out why.  
Is there something I missed?

Thanks in advance.

---

<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: [January 1, 2020, 7:44am UTC](https://discuss.elastic.co/t/timeout-issue-when-using-reindex-api/210484/2 "2020-01-01T07:44:52Z")

</div>

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