I am running bulk query on elastic search for updating user's nested properties.
Below is the query which I am executing to update user's properties. It updates around 200 properties of single user.
It takes around 5000 mili seconds
Machine configuration on Amazon Aws
Master : 1, c4.large
Data Nodes : 2 c4.2xlarge
POST /INDEX_NAME/user/_bulk
{"update":{"_id":"55950ed51d4213241f7c38b4","type":"user","index":"jal","routing":2,"_retry_on_conflict":5,"refresh":true}}
{"lang":"mvel","script":"foreach (item : ctx._source.category) { if (item[ 'key' ] == key) { if(item[ 'name' ]==null){item[ 'name' ] =name;} } }","params":{"key":"26069_purchased","name":"26069"}}
{"update":{"_id":"55950ed51d4213241f7c38b4","type":"user","index":"jal","routing":2,"_retry_on_conflict":5,"refresh":true}}
{"lang":"mvel","script":"foreach (item : ctx._source.category) { if (item[ 'key' ] == key) { if(item[ 'action' ]==null){item[ 'action' ] =action;} } }","params":{"key":"26069_purchased","action":"purchased"}}
{"update":{"_id":"55950ed51d4213241f7c38b4","type":"user","index":"jal","routing":2,"_retry_on_conflict":5,"refresh":true}}
{"lang":"mvel","script":"foreach (item : ctx._source.category) { if (item[ 'key' ] == key) {if(item[ 'price' ]==null){item[ 'price' ]=price;}else{ item[ 'price' ]=item[ 'price' ]+ price;} } }","params":{"key":"26069_purchased","price":0}}
{"update":{"_id":"55950ed51d4213241f7c38b4","type":"user","index":"jal","routing":2,"_retry_on_conflict":5,"refresh":true}}
{"lang":"mvel","script":"foreach (item : ctx._source.category) { if (item[ 'key' ] == key) {if(item[ 'count' ]==null){item[ 'count' ]=count;}else{ item[ 'count' ]=item[ 'count' ]+ count;} } }","params":{"key":"26069_purchased","count":1}}
{"update":{"_id":"55950ed51d4213241f7c38b4","type":"user","index":"jal","routing":2,"_retry_on_conflict":5,"refresh":true}}
{"lang":"mvel","script":"foreach (item : ctx._source.category) { if (item[ 'key' ] == key) {if(item[ 'last_date' ]==null){item[ 'last_date' ]=last_date;}else{ item[ 'last_date' ] = last_date; } }}","params":{"key":"26069_purchased","last_date":"2015-06-20T15:37:09"}}
{"update":{"_id":"55950ed51d4213241f7c38b4","type":"user","index":"jal","routing":2,"_retry_on_conflict":5,"refresh":true}}
{"lang":"mvel","script":"foreach (item : ctx._source.category) { if (item[ 'key' ] == key) {if(item[ 'without_promo' ]==null){item[ 'without_promo' ]=without_promo;}else{ item[ 'without_promo' ]=item[ 'without_promo' ]+ without_promo;} } }","params":{"key":"26069_purchased","without_promo":1}}