public void dateHistogramFacet() throws Exception {
DateHistogramFacetBuilder facet = FacetBuilders.dateHistogramFacet("f")
.field("date")
.interval("year");
DateHistogramFacet f = (DateHistogramFacet) launchSearch(facet, "f");
// For each entry
for (DateHistogramFacet.Entry entry : f) {
entry.getTime(); // Date in ms since epoch (X-Axis)
entry.getCount(); // Doc count (Y-Axis)