.execute().actionGet();
totalQueryTime += searchResponse.getTookInMillis();
if (searchResponse.getFailedShards() > 0) {
System.err.println("Search Failures " + Arrays.toString(searchResponse.getShardFailures()));
}
Children children = searchResponse.getAggregations().get("to-child");
if (j % 10 == 0) {
System.out.println("--> children doc count [" + j + "], got [" + children.getDocCount() + "]");
}
}
System.out.println("--> children agg, Query Avg: " + (totalQueryTime / QUERY_COUNT) + "ms");
System.out.println("--> Running children agg with match_all");
totalQueryTime = 0;
for (int j = 1; j <= QUERY_COUNT; j++) {
SearchResponse searchResponse = client.prepareSearch(indexName)
.addAggregation(
AggregationBuilders.children("to-child").childType("child")
)
.execute().actionGet();
totalQueryTime += searchResponse.getTookInMillis();
if (searchResponse.getFailedShards() > 0) {
System.err.println("Search Failures " + Arrays.toString(searchResponse.getShardFailures()));
}
Children children = searchResponse.getAggregations().get("to-child");
if (j % 10 == 0) {
System.out.println("--> children doc count [" + j + "], got [" + children.getDocCount() + "]");
}
}
System.out.println("--> children agg, Query Avg: " + (totalQueryTime / QUERY_COUNT) + "ms");
// run parent child constant query