# Converting large fields during reindex ends with 429

**URL:** <https://discuss.elastic.co/t/converting-large-fields-during-reindex-ends-with-429/314568>\
**Category:** Elasticsearch\
**Tags:** reindex\
**Created:** [September 16, 2022, 10:21am UTC](https://discuss.elastic.co/t/converting-large-fields-during-reindex-ends-with-429/314568 "2022-09-16T10:21:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lubosvr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lubosvr/32/104400_2.png) [@lubosvr](https://discuss.elastic.co/u/lubosvr)\
**Post date:** [September 16, 2022, 10:21am UTC](https://discuss.elastic.co/t/converting-large-fields-during-reindex-ends-with-429/314568/1 "2022-09-16T10:21:21Z")

</div>

I'm trying to reindex a complex document into a simple one and I have troubles with embedded fields.

I have a document like this:

```auto
POST from/_doc/1
{
  "systemMetadata" : {
    "a:b:c:searchContentHTML" : {
      "textValue" : "This is a very long text 43MB...."
    }
  }
}

```

And I'm trying to reindex it to something like:

```auto
{
  "textValue" : "This is a very long text 43MB...."
}

```

I have no luck. Can you pls help?

```auto
POST _reindex
{
  "source": {
    "index": "from",
    "_source": ["systemMetadata.a:b:c:searchContentHTML"]
  },
  "dest": {
    "index": "htmlcontent"
  },
  "script": {
    "source": "ctx._source.textValue = ctx._source.systemMetadata['a:b:c:searchContentHTML'].textValue;"
  }
}

```

It works fine for small document, but when the `textValue` is huge (43MB) I'm getting 429 error

```auto
{
  "error" : {
    "root_cause" : [
      {
        "type" : "es_rejected_execution_exception",
        "reason" : "rejected execution of coordinating operation [coordinating_and_primary_bytes=0, replica_bytes=0, all_bytes=0, coordinating_operation_bytes=117199244, max_coordinating_and_primary_bytes=107374182]"
      }
    ],
    "type" : "es_rejected_execution_exception",
    "reason" : "rejected execution of coordinating operation [coordinating_and_primary_bytes=0, replica_bytes=0, all_bytes=0, coordinating_operation_bytes=117199244, max_coordinating_and_primary_bytes=107374182]"
  },
  "status" : 429
}

```

Can you please advice what is the reason of this error and what is correct solution?  
When using this query it works without error, but the `textValue` is `null` and the orifinal field is not removed

```auto
POST _reindex
{
  "source": {
    "index": "from",
    "_source": ["systemMetadata.a:b:c:searchContentHTML"]
  },
  "dest": {
    "index": "htmlcontent"
  },
  "script": {
    "source": "ctx._source.textValue = ctx._source.remove('systemMetadata.a:b:c:searchContentHTML.textValue')"
  }
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 18, 2022, 11:12pm UTC](https://discuss.elastic.co/t/converting-large-fields-during-reindex-ends-with-429/314568/2 "2022-09-18T23:12:48Z")

</div>

The error is saying that you are overloading your cluster, likely due to the size of those fields.

You might want to look at [Reindex API | Elasticsearch Guide [8.4] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.4/docs-reindex.html#docs-reindex-slice) to reduce the size of each reindex request into something that the nodes can handle.

---

<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:** [October 16, 2022, 11:13pm UTC](https://discuss.elastic.co/t/converting-large-fields-during-reindex-ends-with-429/314568/3 "2022-10-16T23:13:42Z")

</div>

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