4
有沒有辦法獲得行數並按小時,天或月分組。在彈性搜索中按日期範圍獲取計數和分組
例如,假設我有消息
_source{
"timestamp":"2013-10-01T12:30:25.421Z",
"amount":200
}
_source{
"timestamp":"2013-10-01T12:35:25.421Z",
"amount":300
}
_source{
"timestamp":"2013-10-02T13:53:25.421Z",
"amount":100
}
_source{
"timestamp":"2013-10-03T15:53:25.421Z",
"amount":400
}
有沒有辦法得到的東西單獨的線{日期,金額}(不一定以這種格式,如果有什麼辦法只是想知道我可以做到這一點)
{
{"2013-10-01T12:00:00.000Z", 500},
{"2013-10-02T13:00:00.000Z", 100},
{"2013-10-03T15:00:00.000Z", 400}
}
謝謝
你有什麼試過?看看[日期直方圖](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-facets-date-histogram-facet.html) – javanna
我現在正在研究它..謝謝:) –