Hi,
Below is my use case
= % of requests where [actual_Date] <= [Planned_Date]+24 hrs)
I have written below query
GET data_index1/_search
{
"size": 1000,
"query": {
"match_all": {}
},
"aggs": {
"NAME": {
"value_count": {
"script": {
"lang": "painless",
"source": "doc['actual_Date'].value.toInstant().toEpochMilli() <= doc['Planned_Date'].value.toInstant().toEpochMilli()"
}
}
}
}
}
I am not able to figure out how to calculate +24 hours and add it .
24 hours i need to calculate as below
"source": "doc['start_Date'].value.toInstant().toEpochMilli() -doc['end_Date'].value.toInstant().toEpochMilli()"
Please help me with this
Thanks in advance