问题:
如何进行日期范围聚合并显示与相关日期桶匹配的所有文档,而不是doc_count
.
聚合:
{
"aggs" : {
"articles_over_time" : {
"date_histogram" : {
"field" : "date",
"interval" : "1M",
"format" : "yyyy-MM-dd"
}
}
}
}
回复:
{
"aggregations": {
"articles_over_time": {
"buckets": [
{
"key_as_string": "2013-02-02",
"key": 1328140800000,
"doc_count": 1
},
{
"key_as_string": "2013-03-02",
"key": 1330646400000,
"doc_count": 2 //how display whole json ??
[ .. Here i want to display
all document with array based
NOT only doc_count:2.......... ]
},
...
]
}
}
}
也许我需要做一些子聚合或其他事情?
有任何想法吗?