Seeing Parsing Exception when trying to calculate percentile across various fields, Any idea what can be done here?
Document:
{
"county" : "Santa Clara",
"city": "San Jose",
"date" : 123432342342,
"user" : {
"0" : {
"name" : "abc",
"metrics" : {
"m1" : 100.0,
"m2" : 200.0
}
},
"1" : {
"name" : "abc1",
"metrics" : {
"m1" : 100.0,
"m2" : 200.0
}
}
}
}
Query Used:
"aggs" : {
"percentile_agg" : {
"percentiles" : {
"field" : ["user.0.metric.m1", "user.1.metric.m1"],
"percents": [
50,
90,
99,
99.9,
100
],
"hdr": {
"number_of_significant_value_digits" : 3
}
}
}
Exception Seen:
{
"error": {
"root_cause": [
{
"type": "parsing_exception",
"reason": "[percentiles] field doesn't support values of type: START_ARRAY",
"line": 17,
"col": 27
}
],
"type": "parsing_exception",
"reason": "[percentiles] field doesn't support values of type: START_ARRAY",
"line": 17,
"col": 27
},
"status": 400
}
Would it be easier if I make user as an array? Using Elasticsearch 6.2