`Hi ,
I am writing query to find hourly count with some filter:
date histogram doc count with interval day is correct, but giving more doc count with hour
For example my query with interval day:
`GET _search
{
"size": 0,
"aggs": {
"eventtime": {
"filter": {
"bool": {
"must": [
{
"term": {
"RW.RT": "152"
}
},
{
"term": {
"RW.RE": "received"
}
}
]
}
},
"aggregations": {
"timeslice": {
"date_histogram": {
"field": "RW.DT",
"interval": "day",
"format" : "YYYY-MM-dd HH:MM:ss",
"min_doc_count":1
}
}
}
}
}}Output is :
"hits": {
"total": 147,
"max_score": 0,
"hits": []
},
"aggregations": {
"eventtime": {
"doc_count": 6,
"timeslice": {
"buckets": [
{
"key_as_string": "2016-07-14 00:07:00",
"key": 1468454400000,
"doc_count": 6
}
]
}
}
}This is ok..but when i change interval with hour .. Output is
"hits": {
"total": 147,
"max_score": 0,
"hits": []
},
"aggregations": {
"eventtime": {
"doc_count": 6,
"timeslice": {
"buckets": [
{
"key_as_string": "2016-07-14 07:07:00",
"key": 1468479600000,
"doc_count": 1
},
{
"key_as_string": "2016-07-14 08:07:00",
"key": 1468483200000,
"doc_count": 2
},
{
"key_as_string": "2016-07-14 09:07:00",
"key": 1468486800000,
"doc_count": 4
},
{
"key_as_string": "2016-07-14 12:07:00",
"key": 1468497600000,
"doc_count": 1
},
{
"key_as_string": "2016-07-14 13:07:00",
"key": 1468501200000,
"doc_count": 1
}
]
}
}
}`
Here in output doc count is 9, this should be 6
Please help me
`