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

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

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

RestHighLevelClient.multiSearch介绍

[英]Executes a multi search using the msearch API. See Multi search API on elastic.co
[中]使用msearch API执行多重搜索。见Multi search API on elastic.co

代码示例

代码示例来源:origin: spring-projects/spring-data-elasticsearch

private MultiSearchResponse.Item[] getMultiSearchResult(MultiSearchRequest request) {
  MultiSearchResponse response;
  try {
    response = client.multiSearch(request);
  } catch (IOException e) {
    throw new ElasticsearchException("Error for search request: " + request.toString(), e);
  }
  MultiSearchResponse.Item[] items = response.getResponses();
  Assert.isTrue(items.length == request.requests().size(), "Response should has same length with queries");
  return items;
}

代码示例来源:origin: DigitalPebble/storm-crawler

response = connection.getClient().multiSearch(multiSearchRequest);
} catch (IOException e) {
  LOG.error("Exception caught when getting multisearch", e);

相关文章