I'm using dateHistogram aggregation with ElasticSearch Java API, and it works pretty well for simple aggregations, such as the number of hits per hour/day/month/year (imagine a series of documents, where the date histogram aggregation is made on 'indexed_date' field).
But, can I, with a single query, make a multi-field date aggregation, in relation to another field? Something like what Kibana does for charts.
An example of what I would like to achieve:
I have a series of documents, where each one is an "event", which has its timestamp. These documents have a series of fields, like "status", "version", etc.
Can I get an aggregation, based on date histogram, on timestamp field and on all values of another field?
Example result of aggregation with a one hour interval:
H: 12 status - { ACTIVE: 34 PAUSED: 12 }
H: 13 status - { ACTIVE: 10 }
EDIT:
Some sample data:
"doc1" - { timestamp: "2014-12-23 12:01", status: "ACTIVE", version: 1 }
"doc2" - { timestamp: "2014-12-23 12.15", status: "PAUSED", version: 1 }
"doc3" - { timestamp: "2014-12-23 13.55", status: "ACTIVE", version: 2 }
(and so on..)