Package org.elasticsearch.search.aggregations.bucket.children

Examples of org.elasticsearch.search.aggregations.bucket.children.Children


                    .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
View Full Code Here

TOP

Related Classes of org.elasticsearch.search.aggregations.bucket.children.Children

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.