Examples of prepareSearchScroll()


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

          // 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;
        for (SearchHit hit : scrollResp.getHits()) {
          bw.write(hit.getId());
          bw.write(JSON_RECORD_DELIMITER);
View Full Code Here

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

        if (! commandLineOptions.isFix()) {
            LOG.warn("Not executing update because '-F' command line flag not given!");
        }

        while (true) {
            final SearchResponse r = client.prepareSearchScroll(response.getScrollId()).setScroll(TimeValue.timeValueMinutes(1)).execute().actionGet();

            if (r.getHits().getHits().length == 0) {
                LOG.debug("No more hits, done!");
                break;
            }
View Full Code Here

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

        String scrollId = searchResponse.getScrollId();
        int scrollRequestCounter = 0;
        long sumTimeSpent = 0;
        while (true) {
            long timeSpent = System.currentTimeMillis();
            searchResponse = client.prepareSearchScroll(scrollId).setScroll("10m").get();
            sumTimeSpent += (System.currentTimeMillis() - timeSpent);
            scrollRequestCounter++;
            if (searchResponse.getHits().getTotalHits() != numDocs) {
                System.err.printf(Locale.ENGLISH, "Expected total hits [%d] but got [%d]\n", numDocs, searchResponse.getHits().getTotalHits());
            }
View Full Code Here

Examples of org.sonar.server.search.SearchClient.prepareSearchScroll()

      SearchClient searchClient = new SearchClient(new Settings(), profiling);
      SearchResponse search = searchClient.prepareSearch(IndexDefinition.RULE.getIndexName())
        .setSearchType(SearchType.SCAN)
        .setScroll(TimeValue.timeValueSeconds(3L))
        .get();
      searchClient.prepareSearchScroll(search.getScrollId()).get();

      // expected to fail because elasticsearch is not correctly configured, but that does not matter
      fail();
    } catch (Exception e) {
      assertThat(e).isInstanceOf(IllegalStateException.class);
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.