Examples of prepareSearch()


Examples of com.dotcms.repackage.org.elasticsearch.client.Client.prepareSearch()

          bw.write(MAPPING_MARKER);
          bw.write(mapping);
          bw.newLine();

          // setting up the search for all content
      SearchResponse scrollResp = client.prepareSearch(index).setSearchType(SearchType.SCAN).setQuery(QueryBuilders.matchAllQuery())
          .setSize(100).setScroll(TimeValue.timeValueMinutes(2)).execute().actionGet();
      while (true) {
        scrollResp = client.prepareSearchScroll(scrollResp.getScrollId()).setScroll(TimeValue.timeValueMinutes(2)).execute()
            .actionGet();
        boolean hitsRead = false;
View Full Code Here

Examples of com.dotcms.repackage.org.elasticsearch.client.Client.prepareSearch()

        Client client = new ESClient().getClient();
        SearchResponse resp;
        try {
            QueryStringQueryBuilder qb = QueryBuilders.queryString( qq );
            SearchRequestBuilder srb = client.prepareSearch();
            srb.setQuery( qb );

            srb.setIndices( indexName );
            srb.addFields( "id" );
View Full Code Here

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

    private void run(final CommandLineOptions commandLineOptions, final String[] args) {
        startEsNode();

        final Client client = node.client();
        final SearchRequestBuilder srb = client.prepareSearch();

        final CountResponse countResponse = client.prepareCount(commandLineOptions.getIndicesArray()).execute().actionGet();
        final long totalCount = countResponse.getCount();

        long changedCount = 0;
View Full Code Here

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

        indexingThread.start();

        Thread searchThread = new Thread() {
            @Override public void run() {
                while (!stop.get()) {
                    client.prepareSearch()
                            .setQuery(filteredQuery(matchAllQuery(), rangeFilter("field").from(System.currentTimeMillis() - 1000000)))
                            .execute().actionGet();
                }
            }
        };
View Full Code Here

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

        System.out.println("--> Number of docs in index: " + client.prepareCount().setQuery(matchAllQuery()).execute().actionGet().count());

        System.out.println("--> Running just child query");
        // run just the child query, warm up first
        for (int j = 0; j < QUERY_WARMUP; j++) {
            SearchResponse searchResponse = client.prepareSearch().setQuery(termQuery("child.tag", "tag1")).execute().actionGet();
            if (j == 0) {
                System.out.println("--> Warmup took: " + searchResponse.took());
            }
            if (searchResponse.hits().totalHits() != COUNT) {
                System.err.println("--> mismatch on hits");
View Full Code Here

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

            }
        }

        long totalQueryTime = 0;
        for (int j = 0; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch().setQuery(termQuery("child.tag", "tag1")).execute().actionGet();
            if (searchResponse.hits().totalHits() != COUNT) {
                System.err.println("--> mismatch on hits");
            }
            totalQueryTime += searchResponse.tookInMillis();
        }
View Full Code Here

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

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

        System.out.println("--> Running has_child query");
        // run parent child constant query
        for (int j = 0; j < QUERY_WARMUP; j++) {
            SearchResponse searchResponse = client.prepareSearch().setQuery(hasChildQuery("child", termQuery("tag", "tag1"))).execute().actionGet();
            if (searchResponse.failedShards() > 0) {
                System.err.println("Search Failures " + Arrays.toString(searchResponse.shardFailures()));
            }
            if (searchResponse.hits().totalHits() != COUNT) {
                System.err.println("--> mismatch on hits [" + j + "], got [" + searchResponse.hits().totalHits() + "], expected [" + COUNT + "]");
View Full Code Here

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

            }
        }

        totalQueryTime = 0;
        for (int j = 0; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch().setQuery(hasChildQuery("child", termQuery("tag", "tag1"))).execute().actionGet();
            if (searchResponse.failedShards() > 0) {
                System.err.println("Search Failures " + Arrays.toString(searchResponse.shardFailures()));
            }
            if (searchResponse.hits().totalHits() != COUNT) {
                System.err.println("--> mismatch on hits [" + j + "], got [" + searchResponse.hits().totalHits() + "], expected [" + COUNT + "]");
View Full Code Here

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

        System.out.println("--> has_child 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++) {
            SearchResponse searchResponse = client.prepareSearch().setQuery(topChildrenQuery("child", termQuery("tag", "tag1"))).execute().actionGet();
            // we expect to have mismatch on hits here
//            if (searchResponse.hits().totalHits() != COUNT) {
//                System.err.println("mismatch on hits");
//            }
        }
View Full Code Here

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

//            }
        }

        totalQueryTime = 0;
        for (int j = 0; j < QUERY_COUNT; j++) {
            SearchResponse searchResponse = client.prepareSearch().setQuery(topChildrenQuery("child", termQuery("tag", "tag1"))).execute().actionGet();
            // we expect to have mismatch on hits here
//            if (searchResponse.hits().totalHits() != COUNT) {
//                System.err.println("mismatch on hits");
//            }
            totalQueryTime += searchResponse.tookInMillis();
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.