{
"actualdatetime": "2016-May-19 00:00:00.965 +05:30",
"messagedeliverytime": "Thu May 19 00:00:00 2016",
"messagesubmissiontime": "Wed May 18 23:59:13 2016"
}
This is my actual document. I need a new field "latency" by doing
"(doc['messagedeliverytime'].value - doc['messagesubmissiontime'].value) / 1000"
And insert it as
{
"actualdatetime": "2016-May-19 00:00:00.965 +05:30",
"messagedeliverytime": "Thu May 19 00:00:00 2016",
"messagesubmissiontime": "Wed May 18 23:59:13 2016",
"latency":"47"
}
Is there any scripting which will run the calculation while indexing the documents and create the new field on the fly???