.setSource("test_field", "test " + i, "even", i % 2 == 0)
.get();
}
client().admin().indices().prepareRefresh("test-idx").execute().actionGet();
SubAggCollectionMode aggCollectionMode = randomFrom(SubAggCollectionMode.values());
SearchResponse response = client().prepareSearch("test-idx")
.setQuery(QueryBuilders.termQuery("even", true))
.addAggregation(AggregationBuilders.terms("test").field("test_field").size(recordCount * 2)
.collectMode(aggCollectionMode))