I'm seeing strange behaviour when using the aggregations against a number field - avg, max etc
Given this result set:
I'd expect to be able to generate visualisations against the max of these values or the average. The behaviour I'm seeing is that aggregation requests always return zero?
Here's a sample request and response:
{
"size": 0,
"query": {
"filtered": {
"query": {
"query_string": {
"query": "*",
"analyze_wildcard": true
}
},
"filter": {
"bool": {
"must": [
{
"range": {
"StartTime": {
"gte": 1468191600000,
"lte": 1468277999999,
"format": "epoch_millis"
}
}
}
],
"must_not": []
}
}
}
},
"aggs": {
"2": {
"date_histogram": {
"field": "StartTime",
"interval": "10m",
"time_zone": "Europe/London",
"min_doc_count": 1,
"extended_bounds": {
"min": 1468191600000,
"max": 1468277999999
}
},
"aggs": {
"1": {
"max": {
"field": "TotalErrorPercentage"
}
}
}
}
}
}
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 30,
"successful": 30,
"failed": 0
},
"hits": {
"total": 36,
"max_score": 0,
"hits": []
},
"aggregations": {
"2": {
"buckets": [
{
"1": {
"value": 0
},
"key_as_string": "2016-07-11T07:20:00.000+01:00",
"key": 1468218000000,
"doc_count": 1
},
{
"1": {
"value": 0
},
"key_as_string": "2016-07-11T07:30:00.000+01:00",
"key": 1468218600000,
"doc_count": 12
},
{
"1": {
"value": 0
},
"key_as_string": "2016-07-11T07:40:00.000+01:00",
"key": 1468219200000,
"doc_count": 5
},
{
"1": {
"value": 0
},
"key_as_string": "2016-07-11T07:50:00.000+01:00",
"key": 1468219800000,
"doc_count": 4
},
{
"1": {
"value": 0
},
"key_as_string": "2016-07-11T08:00:00.000+01:00",
"key": 1468220400000,
"doc_count": 6
},
{
"1": {
"value": 0
},
"key_as_string": "2016-07-11T08:10:00.000+01:00",
"key": 1468221000000,
"doc_count": 6
},
{
"1": {
"value": 0
},
"key_as_string": "2016-07-11T08:20:00.000+01:00",
"key": 1468221600000,
"doc_count": 2
}
]
}
}
}