.getBytes("UTF-8"))
.execute().actionGet();
assertThat(searchResponse.hits().totalHits(), equalTo(documentCount));
TermsFacet facet = searchResponse.facets().facet("facet1");
logFacet(facet);
assertThat(facet.name(), equalTo("facet1"));
assertThat(facet.entries().size(), equalTo(facet_size));
assertThat(facet.totalCount(),equalTo(fieldTokenCount));
assertThat(facet.missingCount(),equalTo(1L)); // one missing doc.
for (int term=maxTermCount()-facet_size+1;term<=maxTermCount();term++) {
int facet_pos = maxTermCount()-term;
String termS = getTerm(term,true);
assertThat(facet.entries().get(facet_pos).term(),equalTo(String.format("%s|%s",termS,
HashedStringFieldType.hashCode(termS))));
assertThat(facet.entries().get(facet_pos).count(),equalTo(term));
}
}
}