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

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

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

RestHighLevelClient.clearScroll介绍

[英]Clears one or more scroll ids using the Clear Scroll API. See Clear Scroll API on elastic.co
[中]

代码示例

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

@Override
public void clearScroll(String scrollId) {
  ClearScrollRequest request = new ClearScrollRequest();
  request.addScrollId(scrollId);
  try {
    // TODO: Something useful with the response.
    ClearScrollResponse response = client.clearScroll(request);
  } catch (IOException e) {
    throw new ElasticsearchException("Error for search request with scroll: " + request.toString(), e);
  }
}

代码示例来源:origin: org.nuxeo.elasticsearch/nuxeo-elasticsearch-core

@Override
public ClearScrollResponse clearScroll(ClearScrollRequest request) {
  try {
    if (log.isDebugEnabled()) {
      log.debug(String.format("Clearing scroll ids: %s", Arrays.toString(request.getScrollIds().toArray())));
    }
    return client.clearScroll(request, RequestOptions.DEFAULT);
  } catch (ElasticsearchStatusException e) {
    if (RestStatus.NOT_FOUND.equals(e.status())) {
      if (log.isDebugEnabled()) {
        log.debug(String.format("Scroll ids not found, they have certainly been already closed: %s",
            Arrays.toString(request.getScrollIds().toArray())));
      }
      return new ClearScrollResponse(true, 0);
    }
    throw new NuxeoException(e);
  } catch (IOException e) {
    throw new NuxeoException(e);
  }
}

代码示例来源:origin: eea/eea.elasticsearch.river.rdf

ClearScrollResponse clearScrollResponse = client.clearScroll(clearScrollRequest);
  boolean succeeded = clearScrollResponse.isSucceeded();
} catch (IOException e) {

代码示例来源:origin: eea/eea.elasticsearch.river.rdf

ClearScrollResponse clearScrollResponse = client.clearScroll(clearScrollRequest);
  boolean succeeded = clearScrollResponse.isSucceeded();
} catch (IOException e) {

相关文章