# BIG\_INTEGER issues in nested documents during reindex

**URL:** <https://discuss.elastic.co/t/big-integer-issues-in-nested-documents-during-reindex/135430>\
**Category:** Elasticsearch\
**Created:** [June 11, 2018, 8:28pm UTC](https://discuss.elastic.co/t/big-integer-issues-in-nested-documents-during-reindex/135430 "2018-06-11T20:28:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![afaraone](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@afaraone](https://discuss.elastic.co/u/afaraone)\
**Post date:** [June 11, 2018, 8:28pm UTC](https://discuss.elastic.co/t/big-integer-issues-in-nested-documents-during-reindex/135430/1 "2018-06-11T20:28:15Z")

</div>

Working in V. 2.4.3

I have to reindex our data, and am running into an issue with Integer string parsing (specifically parsing strings as integers)

The Error  
`{"error":{"root_cause":[{"type":"illegal_state_exception","reason":"No matching token for number_type [BIG_INTEGER]"}],"type":"illegal_state_exception","reason":"No matching token for number_type [BIG_INTEGER]"},"status":500}`

My script so far:  
`if(ctx._source.field_one) {for (s in ctx._source.field_one.values) {if(s.ref_data_1) {s.ref_data_1.value = s.ref_data_1.value.toString();}; if(s.ref_data_4) {s.ref_data_4.value = s.ref_data_4.value.toString();};};};`

the offending data seems to be a string that has a numerical value 19 characters long -- So it makes sense that the error is occuring, based on previous posts ([No matching token for number\_type [BIG\_INTEGER]](https://discuss.elastic.co/t/no-matching-token-for-number-type-big-integer/48759) in particular). Is there a way, via a script while reindexing, to correctly move over from the previous to the new index with these values? Is there any way to avoid the step that tries to parse the value as an Int?

To muddy the waters I'm trying to do this for a list of nested documents, if those nested documents exist. I'm not sure I'm scripting it the correct way to begin with. Help on either front would be great!

---

<div class="post-metadata">

**Author:** ![afaraone](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@afaraone](https://discuss.elastic.co/u/afaraone)\
**Post date:** [June 18, 2018, 4:37pm UTC](https://discuss.elastic.co/t/big-integer-issues-in-nested-documents-during-reindex/135430/2 "2018-06-18T16:37:56Z")

</div>

We have found two solutions to this issue. One is simply to remove the script associated with the reindex. doing so will allow the whole reindex to happen without issue.

We do have other things that we need to do in script, though, and have been able to find a work around in elasticsearch-reindex, the older node library that allows you do do reindexing on a remote server, and run dynamic node against the records as they flow through the remote server.

---

<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:** [July 16, 2018, 4:37pm UTC](https://discuss.elastic.co/t/big-integer-issues-in-nested-documents-during-reindex/135430/3 "2018-07-16T16:37:58Z")

</div>

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