Hi,
I have in my document this construct
"data": {
"group_randomId1": {
"date1": "ISO8601",
"date2": "ISO8601"
},
"group_randomId2": {
"date1": "ISO8601",
"date2": "ISO8601"
},
"group_randomIdN": {
"date1": "ISO8601",
"date2": "ISO8601"
}
}
What I want to do is use a percentile aggregation to compute the percentiles on date2-date1.
I'm blocked at this point because I actually would likle to have something like:
{
"size": 0,
"aggs": {
"toMove": {
"percentiles": {
"script": {
"lang": "painless",
"source": "doc['data.*.date2'].value.getMillis() - doc['data.*.date1'].value.getMillis()"
}
}
}
}
}
The '*' notation is not supported so how can I write my script to loop through the different groups?
The data groups are added by upsert operations (and a pipeline processor).
Thanks for your help!