I have elasticsearch document as below.
{
"ProductID": 123,
"SellingPrice": 1200.00,
"DiscountAmount":0.00,
"Discount": {
"Type": "percentage",
"Amount": 25,
"StartDate": "2014-08-13T12:05:00",
"EndDate": "2014-12-31T12:10:00"
}
}
Whenever i retrieve this document, script should automatically check the Endate with Current system date, if discount is not expired, It should change "DiscountAmount" field based on discount percentage in the result. Please help me on this.