本文整理汇总了Java中org.elasticsearch.action.search.ClearScrollRequestBuilder类的典型用法代码示例。如果您正苦于以下问题:Java ClearScrollRequestBuilder类的具体用法?Java ClearScrollRequestBuilder怎么用?Java ClearScrollRequestBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClearScrollRequestBuilder类属于org.elasticsearch.action.search包,在下文中一共展示了ClearScrollRequestBuilder类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: clearScroll
import org.elasticsearch.action.search.ClearScrollRequestBuilder; //导入依赖的package包/类
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<>());
});
}
开发者ID:pitchpoint-solutions,项目名称:sfs,代码行数:21,代码来源:ScanAndScrollStreamProducer.java
示例2: scrollNext
import org.elasticsearch.action.search.ClearScrollRequestBuilder; //导入依赖的package包/类
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;
}
开发者ID:pinterest,项目名称:soundwave,代码行数:30,代码来源:EsStore.java
示例3: clearScroll
import org.elasticsearch.action.search.ClearScrollRequestBuilder; //导入依赖的package包/类
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);
}
开发者ID:pitchpoint-solutions,项目名称:sfs,代码行数:13,代码来源:ListContainers.java
示例4: clearScroll
import org.elasticsearch.action.search.ClearScrollRequestBuilder; //导入依赖的package包/类
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);
}
开发者ID:pitchpoint-solutions,项目名称:sfs,代码行数:13,代码来源:ListObjects.java
示例5: prepareClearScroll
import org.elasticsearch.action.search.ClearScrollRequestBuilder; //导入依赖的package包/类
public ClearScrollRequestBuilder prepareClearScroll(String scrollId) {
return client.prepareClearScroll().addScrollId(scrollId);
}
开发者ID:Lambda-3,项目名称:Stargraph,代码行数:4,代码来源:ElasticClient.java
示例6: prepareClearScroll
import org.elasticsearch.action.search.ClearScrollRequestBuilder; //导入依赖的package包/类
@Override
public ClearScrollRequestBuilder prepareClearScroll() {
return new ClearScrollRequestBuilder(this, ClearScrollAction.INSTANCE);
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AbstractClient.java
示例7: prepareClearScroll
import org.elasticsearch.action.search.ClearScrollRequestBuilder; //导入依赖的package包/类
@Override
public ClearScrollRequestBuilder prepareClearScroll() {
// TODO Auto-generated method stub
return null;
}
开发者ID:winterstein,项目名称:elasticsearch-java-client,代码行数:6,代码来源:DummyClient.java
示例8: closeNow
import org.elasticsearch.action.search.ClearScrollRequestBuilder; //导入依赖的package包/类
@Override
public void closeNow() {
ClearScrollRequestBuilder scrollRequestBuilder = new ClearScrollRequestBuilder(_client,
ClearScrollAction.INSTANCE).addScrollId(_searchResponse.getScrollId());
scrollRequestBuilder.execute();
}
开发者ID:apache,项目名称:metamodel,代码行数:7,代码来源:ElasticSearchDataSet.java
示例9: prepareClearScroll
import org.elasticsearch.action.search.ClearScrollRequestBuilder; //导入依赖的package包/类
/**
* Clears the search contexts associated with specified scroll ids.
*/
ClearScrollRequestBuilder prepareClearScroll();
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:Client.java
注:本文中的org.elasticsearch.action.search.ClearScrollRequestBuilder类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论