Hi. Im using Elasticseach 6.4
following is my request.
"aggs": {
"times": {
"date_histogram": {
"field": "ccr.key",
"interval": "minute",
"format": "yyyyMMdd:HHmm"
},
"aggs": {
"count" : {
"terms": {
"field": "ccr.count"
}
}
}
},...
}
and following is response
"times": {
"buckets": [
{
"key_as_string": "20190117:1100",
"key": 1547722800000,
"doc_count": 1,
"count": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": 263,
"doc_count": 1
}
]
}
},
{
"key_as_string": "20190117:1101",
"key": 1547722860000,
"doc_count": 0,
"count": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [] // i want to get 0 by default. but there isn't
}
}, ....}
but what i want to make response is following
"times": {
"buckets": [
{
"key_as_string": "20190117:1100",
"key": 1547722800000,
"doc_count": 1,
"count": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": 263,
"doc_count": 1
}
]
}
},
{
"key_as_string": "20190117:1101",
"key": 1547722860000,
"doc_count": 0,
"count": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": 0, // if response bucket is empty, set field 'key' to 0 (by default)
"doc_count": 0 // i don't using this field.
}]
}
}, ....}
can i set it?