org.elasticsearch.client.RestHighLevelClient.mgetAsync()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(1.9k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中org.elasticsearch.client.RestHighLevelClient.mgetAsync方法的一些代码示例,展示了RestHighLevelClient.mgetAsync的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。RestHighLevelClient.mgetAsync方法的具体详情如下:
包路径:org.elasticsearch.client.RestHighLevelClient
类名称:RestHighLevelClient
方法名:mgetAsync

RestHighLevelClient.mgetAsync介绍

[英]Asynchronously retrieves multiple documents by id using the Multi Get API. See Multi Get API on elastic.co
[中]使用Multi-Get API按id异步检索多个文档。见Multi Get API on elastic.co

代码示例

代码示例来源:origin: org.elasticsearch.client/elasticsearch-rest-high-level-client

/**
 * Asynchronously retrieves multiple documents by id using the Multi Get API.
 * See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-multi-get.html">Multi Get API on elastic.co</a>
 * @param multiGetRequest the request
 * @param options the request options (e.g. headers), use {@link RequestOptions#DEFAULT} if nothing needs to be customized
 * @param listener the listener to be notified upon request completion
 * @deprecated use {@link #mgetAsync(MultiGetRequest, RequestOptions, ActionListener)} instead
 */
@Deprecated
public final void multiGetAsync(MultiGetRequest multiGetRequest, RequestOptions options, ActionListener<MultiGetResponse> listener) {
  mgetAsync(multiGetRequest, options, listener);
}

代码示例来源:origin: io.reactiverse/elasticsearch-client

@Override()
public void mgetAsync(MultiGetRequest multiGetRequest, RequestOptions options, Handler<AsyncResult<MultiGetResponse>> handler) {
  Context context = vertx.getOrCreateContext();
  delegate.mgetAsync(multiGetRequest, options, new ActionListener<MultiGetResponse>() {
    @Override
    public void onResponse(MultiGetResponse value) {
      context.runOnContext(v -> handler.handle(Future.succeededFuture(value)));
    }
    @Override
    public void onFailure(Exception e) {
      context.runOnContext(v -> handler.handle(Future.failedFuture(e)));
    }
  });
}

代码示例来源:origin: apache/servicemix-bundles

mgetAsync(multiGetRequest, options, listener);

相关文章