I am performing a percentiles aggregate over data. I also want to perform a bucket_script aggregation, based on the results of the percentiles (defining interquartile range). I am unable to query the percentile values, as I seem to be unable to query over fields that contain a period. Here is my query:
{
"size": 0,
"aggs": {
"base_agg": {
"terms": {"field": "action.keyword"},
"aggs": {
"score_outlier": {
"percentiles": {
"field": "actionParameters.score_numeric"
}
},
"iqr": {
"bucket_script": {
"buckets_path": {
"q1": "score_outlier.values.25.0",
"q3": "score_outlier.values.75.0"
},
"script": "params.q3 - params.q1"
}
}
}
}
}
}
The results from the percentiles aggregate looks as expected:
"score_outlier": {
"values" : {
"1.0": 5.0,
"5.0": 25.0,
"25.0": 165.0,
"50.0": 445.0,
"75.0": 725.0,
"95.0": 945.0,
"99.0": 985.0
}
}
I've tried escaping multiple ways, but no dice:
No aggregation found for path [score_outlier.values.25.0]