Java 类org.elasticsearch.action.search.ClearScrollRequestBuilder 实例源码

项目:sfs    文件:ScanAndScrollStreamProducer.java   
protected Observable<Void> clearScroll() {
    return defer(() -> {
        if (scrollId == null) {
            return aVoid();
        }
        ClearScrollRequestBuilder request = elasticsearch.get().prepareClearScroll()
                .addScrollId(scrollId);

        if (LOGGER.isDebugEnabled()) {
            LOGGER.debug("Request = " + Jsonify.toString(request));
        }

        return elasticsearch.execute(vertxContext, request, elasticsearch.getDefaultGetTimeout())
                .onErrorResumeNext(throwable -> {
                    LOGGER.warn("Handling Clear Scroll Error", throwable);
                    return just(null);
                })
                .map(new ToVoid<>());
    });
}
项目:soundwave    文件:EsStore.java   
protected <E extends EsDocument> ScrollableResponse<List<E>> scrollNext(
    String scrollId, ThrowingFunction<String, E> createFunc)
    throws Exception {
  SearchScrollRequestBuilder
      builder =
      esClient.prepareSearchScroll(scrollId)
          .setScroll(TimeValue.timeValueMillis(SCROLLDEFAULTTIMEOUT));
  SearchResponse response = builder.execute().actionGet();
  ArrayList<E> list = new ArrayList<>();
  ScrollableResponse<List<E>> ret = new ScrollableResponse<>();
  ret.setValue(list);
  ret.setContinousToken(response.getScrollId());
  if (response.getHits().totalHits() == 0) {
    //Clear the scroll as early as possible to save resource
    ClearScrollRequestBuilder
        clearRequestBuilder =
        esClient.prepareClearScroll().addScrollId(scrollId);
    clearRequestBuilder.execute();
    ret.setScrollToEnd(true);
  } else {
    for (int i = 0; i < response.getHits().getHits().length; i++) {
      String str = response.getHits().getAt(i).getSourceAsString();
      E element = createFunc.apply(str);
      element.setId(response.getHits().getAt(i).getId());
      list.add(element);
    }
  }
  return ret;
}
项目:sfs    文件:ListContainers.java   
protected Observable<Void> clearScroll(Elasticsearch elasticSearch, String scrollId) {
    ClearScrollRequestBuilder request =
            elasticSearch.get()
                    .prepareClearScroll()
                    .addScrollId(scrollId);
    return elasticSearch.execute(vertxContext, request, elasticSearch.getDefaultSearchTimeout())
            .onErrorResumeNext(throwable -> {
                LOGGER.warn("Handling Clear Scroll Error", throwable);
                return just(null);
            })
            .map(clearScrollResponseOptional -> null);
}
项目:sfs    文件:ListObjects.java   
protected Observable<Void> clearScroll(Elasticsearch elasticSearch, String scrollId) {
    ClearScrollRequestBuilder request =
            elasticSearch.get()
                    .prepareClearScroll()
                    .addScrollId(scrollId);
    return elasticSearch.execute(vertxContext, request, elasticSearch.getDefaultSearchTimeout())
            .onErrorResumeNext(throwable -> {
                LOGGER.warn("Handling Clear Scroll Error", throwable);
                return Defer.just(null);
            })
            .map(clearScrollResponseOptional -> null);
}
项目:Stargraph    文件:ElasticClient.java   
public ClearScrollRequestBuilder prepareClearScroll(String scrollId) {
    return client.prepareClearScroll().addScrollId(scrollId);
}
项目:elasticsearch_my    文件:AbstractClient.java   
@Override
public ClearScrollRequestBuilder prepareClearScroll() {
    return new ClearScrollRequestBuilder(this, ClearScrollAction.INSTANCE);
}
项目:elasticsearch-java-client    文件:DummyClient.java   
@Override
public ClearScrollRequestBuilder prepareClearScroll() {
    // TODO Auto-generated method stub
    return null;
}
项目:metamodel    文件:ElasticSearchDataSet.java   
@Override
public void closeNow() {
    ClearScrollRequestBuilder scrollRequestBuilder = new ClearScrollRequestBuilder(_client,
            ClearScrollAction.INSTANCE).addScrollId(_searchResponse.getScrollId());
    scrollRequestBuilder.execute();
}
项目:elasticsearch_my    文件:Client.java   
/**
 * Clears the search contexts associated with specified scroll ids.
 */
ClearScrollRequestBuilder prepareClearScroll();