Update elasticsearch with calculation on fields

Hi Guys,

Can I used elasticsearch update for calculate the same fields with plus or minus value??
for example :
first I have this document on elasticsearch
{
"part_no":"aa.bbbb.001ZZ",
"stock_qty":"20.000",
"warehouse_qty":"10.000"
}

then I insert new document

{
"part_no":"aa.bbbb.001ZZ",
"stock_qty":"5.000",
"warehouse_qty":"-3.000"
}

can I use update API to do some calculation for stock_qty (+5) and warehouse_qty (-3)?
and the result will be like

{
"part_no":"aa.bbbb.001ZZ",
"stock_qty":"25.000",
"warehouse_qty":"7.000"
}

Thanks

I think you can do this with scripted updates.

Thanks Warkolm