Package org.elasticsearch.action.search

Examples of org.elasticsearch.action.search.SearchScrollRequestBuilder


                  .setScroll(TimeValue.timeValueSeconds(_scrollTimeoutSeconds))
                  .addSort("_id", SortOrder.ASC).setSize(batchSize);

              responseFuture = _client.search(builder.request());
            } else {
              responseFuture = _client.searchScroll(new SearchScrollRequestBuilder(_client, _scrollId)
                  .request());
            }

            SearchResponse response = responseFuture.actionGet();
View Full Code Here


                  .setScroll(TimeValue.timeValueSeconds(_scrollTimeoutSeconds))
                  .addSort("_id", SortOrder.ASC).setSize(batchSize);

              responseFuture = _client.search(builder.request());
            } else {
              responseFuture = _client.searchScroll(new SearchScrollRequestBuilder(_client, _scrollId)
                  .request());
            }

            SearchResponse response = responseFuture.actionGet();
View Full Code Here

      private final Queue<SearchHit> hits = new ArrayDeque<SearchHit>();

      private void fillQueue() {
        try {
          SearchScrollRequestBuilder esRequest = client.prepareSearchScroll(scrollId)
            .setScroll(TimeValue.timeValueMinutes(3));
          Collections.addAll(hits, esRequest.get().getHits().getHits());
        } catch (Exception e) {
          throw new IllegalStateException("Error while filling in the scroll buffer", e);
        }
      }
View Full Code Here

      .setQuery(QueryBuilders.termsQuery(RuleNormalizer.RuleField.ID.field(), ids));
    SearchResponse scrollResp = request.get();

    List<Rule> rules = newArrayList();
    while (true) {
      SearchScrollRequestBuilder scrollRequest = getClient()
        .prepareSearchScroll(scrollResp.getScrollId())
        .setScroll(TimeValue.timeValueSeconds(3L));

      scrollResp = scrollRequest.get();

      for (SearchHit hit : scrollResp.getHits()) {
        rules.add(toDoc(hit.getSource()));
      }
      // Break condition: No hits are returned
View Full Code Here

                  .setScroll(TimeValue.timeValueSeconds(_scrollTimeoutSeconds))
                  .addSort("_id", SortOrder.ASC).setSize(batchSize);

              responseFuture = _client.search(builder.request());
            } else {
              responseFuture = _client.searchScroll(new SearchScrollRequestBuilder(_client, _scrollId)
                  .request());
            }

            SearchResponse response = responseFuture.actionGet();
View Full Code Here

TOP

Related Classes of org.elasticsearch.action.search.SearchScrollRequestBuilder

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.