我正在尝试创建一个包含日期直方图的图表。除了跨越夏令时,一切正常。请查看下表中的示例,注意10月31日行的问题。有没有人知道如何克服这个问题,并在每个月的第一天开始获取桶。输入是没有时间的日期,因此对于每个记录,时间是午夜。
April 1st 2013, 00:00:00.000 11499
May 1st 2013, 00:00:00.000 11850
June 1st 2013, 00:00:00.000 15992
July 1st 2013, 00:00:00.000 14215
August 1st 2013, 00:00:00.000 14178
September 1st 2013, 00:00:00.000 12739
October 1st 2013, 00:00:00.000 14133
October 31st 2013, 23:00:00.000 13653
November 30th 2013, 23:00:00.000 12537
December 31st 2013, 23:00:00.000 14040
为了使调试更好,这是执行的查询:
{
"size": 0,
"query": {
"query_string": {
"query": "*",
"analyze_wildcard": true
}
},
"aggs": {
"2": {
"date_histogram": {
"field": "orderCreationDate",
"interval": "1M",
"pre_zone": "+02:00",
"pre_zone_adjust_large_interval": true,
"min_doc_count": 1
}
}
}
}