).getBytes("UTF-8"))
.execute().actionGet();
assertThat(searchResponse.hits().totalHits(), equalTo(documentCount));
FacetedDateHistogramFacet facet = searchResponse.facets().facet("facet1");
assertThat(facet.name(), equalTo("facet1"));
List<Entry> entries = facet.collapseToAList();
assertThat(entries.size(), equalTo(2));
assertThat(entries.get(0).time,equalTo(1341187200000L));
assertThat(((TermsFacet)entries.get(0).facet()).getEntries().get(0).getTerm(), equalTo("week1"));
assertThat(entries.get(1).time,equalTo(1341792000000L));
assertThat(((TermsFacet)entries.get(1).facet()).getEntries().get(0).getTerm(), equalTo("week2"));