# Add inner field and update documents

**URL:** <https://discuss.elastic.co/t/add-inner-field-and-update-documents/173712>\
**Category:** Elasticsearch\
**Created:** [March 25, 2019, 9:51am UTC](https://discuss.elastic.co/t/add-inner-field-and-update-documents/173712 "2019-03-25T09:51:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Piechut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/piechut/32/42689_2.png) [@Piechut](https://discuss.elastic.co/u/Piechut)\
**Post date:** [March 25, 2019, 9:51am UTC](https://discuss.elastic.co/t/add-inner-field-and-update-documents/173712/1 "2019-03-25T09:51:25Z")

</div>

Hello everyone!

I changed mapping by adding 'string' inner field of 'text' type to already existing 'amount' field of a 'double' type:  
"amount": {  
"type": "double",  
"fields": {  
"string": {  
"type": "text" - new inner field  
}  
}  
}  
and new documents work fine, but I need to update all previously stored documents, so I could search them by that 'string' field. I tried with \_update\_by\_query and reindexing, but nothing worked and I couldn't find solution so far.  
Is it possible to somehow update all documents or do I need to re-upload all them?

Thanks,  
Tomasz

---

<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 22, 2019, 9:51am UTC](https://discuss.elastic.co/t/add-inner-field-and-update-documents/173712/2 "2019-04-22T09:51:32Z")

</div>

Closed on April 22, 2019, 9:51am UTC

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