Hi all,
I think I've been staring at the screen too long because my brain has stopped working!
Here is the scenario.. I have a mapping with a nested type - here is a snippet of mapping:
"dt" : {"type" : "date"},
"obs" : { "type" : "nested", "properties" : {"hr" : {"type" : "byte"},"val" : {"type" : "half_float"}}}}
The query I am building (snippet below) does the following:
A terms agg on 'date', to create buckets,
->a nested filter on 'hr'
- ->a (nested) max agg over 'val'.
What I'd like to do is generate a histogram of these results - i.e. something like:
"histogram" : {
"field" : -> the result of the max agg over 'val'. ,
"interval" : 0.05
}
I am guessing it is not possible, as there is no pipeline histogram agg type - but I am hoping someone may have a bright idea?
Many thanks,
Paul
My query:
"dts" : {
"terms" : { "field" : "date" },
"aggs" : {
"obs" : {
"nested" : {
"path" : "obs"
},
"aggs" : {
"hours" : {
"filter" : { "terms" : { "obs.hr" : ["11", "12", "13", "14"]} },
"aggs" : {
"thresholds" : {"max" : { "field" : "obs.val" } }
}
}
}
}
}
}
The result (abbreviated).
{
"key_as_string" : "2014-12-24T00:00:00.000Z",
"obs" : {
"hours" : {
"thresholds" : {
"val" : 0.01000213623046875
}
}
}
}