Examples of prepareSearch()


Examples of org.elasticsearch.client.Client.prepareSearch()

        }
        System.out.println("--> has_parent filter with match_all parent query, Query Avg: " + (totalQueryTime / QUERY_COUNT) + "ms");
        System.out.println("--> Running top_children query");
        // run parent child score query
        for (int j = 0; j < QUERY_WARMUP; j++) {
            client.prepareSearch(indexName).setQuery(topChildrenQuery("child", termQuery("field2", parentChildIndexGenerator.getQueryValue()))).execute().actionGet();
        }

        totalQueryTime = 0;
        for (int j = 0; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch(indexName).setQuery(topChildrenQuery("child", termQuery("field2", parentChildIndexGenerator.getQueryValue()))).execute().actionGet();
View Full Code Here

Examples of org.elasticsearch.client.Client.prepareSearch()

            client.prepareSearch(indexName).setQuery(topChildrenQuery("child", termQuery("field2", parentChildIndexGenerator.getQueryValue()))).execute().actionGet();
        }

        totalQueryTime = 0;
        for (int j = 0; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch(indexName).setQuery(topChildrenQuery("child", termQuery("field2", parentChildIndexGenerator.getQueryValue()))).execute().actionGet();
            if (j % 10 == 0) {
                System.out.println("--> hits [" + j + "], got [" + searchResponse.getHits().totalHits() + "]");
            }
            totalQueryTime += searchResponse.getTookInMillis();
        }
View Full Code Here

Examples of org.elasticsearch.client.Client.prepareSearch()

        System.out.println("--> top_children Query Avg: " + (totalQueryTime / QUERY_COUNT) + "ms");

        System.out.println("--> Running top_children query, with match_all as child query");
        // run parent child score query
        for (int j = 0; j < QUERY_WARMUP; j++) {
            client.prepareSearch(indexName).setQuery(topChildrenQuery("child", matchAllQuery())).execute().actionGet();
        }

        totalQueryTime = 0;
        for (int j = 0; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch(indexName).setQuery(topChildrenQuery("child", matchAllQuery())).execute().actionGet();
View Full Code Here

Examples of org.elasticsearch.client.Client.prepareSearch()

            client.prepareSearch(indexName).setQuery(topChildrenQuery("child", matchAllQuery())).execute().actionGet();
        }

        totalQueryTime = 0;
        for (int j = 0; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch(indexName).setQuery(topChildrenQuery("child", matchAllQuery())).execute().actionGet();
            if (j % 10 == 0) {
                System.out.println("--> hits [" + j + "], got [" + searchResponse.getHits().totalHits() + "]");
            }
            totalQueryTime += searchResponse.getTookInMillis();
        }
View Full Code Here

Examples of org.elasticsearch.client.Client.prepareSearch()

        System.out.println("--> Used heap size: " + statsResponse.getNodes()[0].getJvm().getMem().getHeapUsed());

        System.out.println("--> Running has_child query with score type");
        // run parent child score query
        for (int j = 0; j < QUERY_WARMUP; j++) {
            client.prepareSearch(indexName).setQuery(hasChildQuery("child", termQuery("field2", parentChildIndexGenerator.getQueryValue())).scoreType("max")).execute().actionGet();
        }

        totalQueryTime = 0;
        for (int j = 0; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch(indexName).setQuery(hasChildQuery("child", termQuery("field2", parentChildIndexGenerator.getQueryValue())).scoreType("max")).execute().actionGet();
View Full Code Here

Examples of org.elasticsearch.client.Client.prepareSearch()

            client.prepareSearch(indexName).setQuery(hasChildQuery("child", termQuery("field2", parentChildIndexGenerator.getQueryValue())).scoreType("max")).execute().actionGet();
        }

        totalQueryTime = 0;
        for (int j = 0; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch(indexName).setQuery(hasChildQuery("child", termQuery("field2", parentChildIndexGenerator.getQueryValue())).scoreType("max")).execute().actionGet();
            if (j % 10 == 0) {
                System.out.println("--> hits [" + j + "], got [" + searchResponse.getHits().totalHits() + "]");
            }
            totalQueryTime += searchResponse.getTookInMillis();
        }
View Full Code Here

Examples of org.elasticsearch.client.Client.prepareSearch()

        }
        System.out.println("--> has_child Query Avg: " + (totalQueryTime / QUERY_COUNT) + "ms");
       
        totalQueryTime = 0;
        for (int j = 0; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch(indexName).setQuery(hasChildQuery("child", matchAllQuery()).scoreType("max")).execute().actionGet();
            if (j % 10 == 0) {
                System.out.println("--> hits [" + j + "], got [" + searchResponse.getHits().totalHits() + "]");
            }
            totalQueryTime += searchResponse.getTookInMillis();
        }
View Full Code Here

Examples of org.elasticsearch.client.Client.prepareSearch()

        System.out.println("--> has_child query with match_all Query Avg: " + (totalQueryTime / QUERY_COUNT) + "ms");
       
        System.out.println("--> Running has_parent query with score type");
        // run parent child score query
        for (int j = 0; j < QUERY_WARMUP; j++) {
            client.prepareSearch(indexName).setQuery(hasParentQuery("parent", termQuery("field1", parentChildIndexGenerator.getQueryValue())).scoreType("score")).execute().actionGet();
        }

        totalQueryTime = 0;
        for (int j = 1; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch(indexName).setQuery(hasParentQuery("parent", termQuery("field1", parentChildIndexGenerator.getQueryValue())).scoreType("score")).execute().actionGet();
View Full Code Here

Examples of org.elasticsearch.client.Client.prepareSearch()

            client.prepareSearch(indexName).setQuery(hasParentQuery("parent", termQuery("field1", parentChildIndexGenerator.getQueryValue())).scoreType("score")).execute().actionGet();
        }

        totalQueryTime = 0;
        for (int j = 1; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch(indexName).setQuery(hasParentQuery("parent", termQuery("field1", parentChildIndexGenerator.getQueryValue())).scoreType("score")).execute().actionGet();
            if (j % 10 == 0) {
                System.out.println("--> hits [" + j + "], got [" + searchResponse.getHits().totalHits() + "]");
            }
            totalQueryTime += searchResponse.getTookInMillis();
        }
View Full Code Here

Examples of org.elasticsearch.client.transport.TransportClient.prepareSearch()

            GetResponse getResponse = client.prepareGet("test", "test", randomId).get();
            assertThat(getResponse.isExists(), equalTo(true));

            refresh();

            SearchResponse searchResponse = client.prepareSearch("test").get();
            assertThat(searchResponse.getHits().totalHits(), equalTo((long)numDocs));

            int randomDocId = randomInt(numDocs-1);
            String fieldValue = "value" + randomDocId;
            String id = "id" + randomDocId;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.