# Bulk adding new field

**URL:** <https://discuss.elastic.co/t/bulk-adding-new-field/51203>\
**Category:** Elasticsearch\
**Created:** [May 27, 2016, 11:14pm UTC](https://discuss.elastic.co/t/bulk-adding-new-field/51203 "2016-05-27T23:14:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Thinesh](https://avatars.discourse-cdn.com/v4/letter/t/bb73d2/32.png) [@Thinesh](https://discuss.elastic.co/u/Thinesh)\
**Post date:** [May 27, 2016, 11:14pm UTC](https://discuss.elastic.co/t/bulk-adding-new-field/51203/1 "2016-05-27T23:14:57Z")

</div>

Hi,

I am trying to add new field to the existing documents via bulk. currently am struggling with below scenario.

Mapping:  
"fourthField": {  
"type": "string",  
"index": "not\_analyzed"  
}

Script:  
{ "script" : "ctx.\_source.fourthField ="1234567890""}

Memory GC warning is logged when I am trying to add "fourthField" with value like above to the existing document via bulk (5000 records at a time) and also read timed out exception is thrown from the client.  
It works fine when I am adding with 3 numeric value "123" to "fourthField". Do we have limitation for field has attribute index as 'not\_analyzed'?

Environment:  
Elasticsearch 2.3.1  
Heap size: 8g (increased from default value)

Thanks.

---

<div class="post-metadata">

**Author:** ![jpountz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jpountz/32/45836_2.png) [@jpountz](https://discuss.elastic.co/u/jpountz)\
**Post date:** [May 30, 2016, 1:57pm UTC](https://discuss.elastic.co/t/bulk-adding-new-field/51203/2 "2016-05-30T13:57:47Z")

</div>

There is no limitation. In my opinion, the GC message you are seeing is mostly due to the fact that you are running an extremely expensive operation: since Lucene does not support in-place updates, this is essentially rewriting the index.

---

<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 5, 2017, 10:48pm UTC](https://discuss.elastic.co/t/bulk-adding-new-field/51203/3 "2017-07-05T22:48:00Z")

</div>


