UpdateByQueryRequest参数没有直接设置waitForCompletion的属性
通过使用封装的submitUpdateByQueryTask方法调用;
TaskSubmissionResponse taskSubmissionResponse = writeHighLevelClient.submitUpdateByQueryTask(request, RequestOptions.DEFAULT);
public final TaskSubmissionResponse submitUpdateByQueryTask(UpdateByQueryRequest updateByQueryRequest,
RequestOptions options) throws IOException {
return performRequestAndParseEntity(
updateByQueryRequest, RequestConverters::submitUpdateByQuery, options, TaskSubmissionResponse::fromXContent, emptySet()
);
}
static Request submitUpdateByQuery(UpdateByQueryRequest updateByQueryRequest) throws IOException {
return prepareUpdateByQueryRequest(updateByQueryRequest, false);
}
private static Request prepareReindexRequest(ReindexRequest reindexRequest, boolean waitForCompletion) throws IOException {
String endpoint = new EndpointBuilder().addPathPart("_reindex").build();
Request request = new Request(HttpPost.METHOD_NAME, endpoint);
Params params = new Params()
.withWaitForCompletion(waitForCompletion)
.withRefresh(reindexRequest.isRefresh())
.withTimeout(reindexRequest.getTimeout())
.withWaitForActiveShards(reindexRequest.getWaitForActiveShards())
.withRequestsPerSecond(reindexRequest.getRequestsPerSecond())
.withSlices(reindexRequest.getSlices());
if (reindexRequest.getScrollTime() != null) {
params.putParam("scroll", reindexRequest.getScrollTime());
}
request.addParameters(params.asMap());
request.setEntity(createEntity(reindexRequest, REQUEST_BODY_CONTENT_TYPE));
return request;
}
- RestHighLevelClient waitForCompletion 脚本 属性resthighlevelclient waitforcompletion脚本 waitforcompletion resthighlevelclient elasticsearch-resthighlevelclient 属性cocoscreator脚本 面板 resthighlevelclient springboot java resthighlevelclient listener timeout waiting resthighlevelclient客户端 客户java 应用程序 脚本powershell属性 elasticsearch-resthighlevelclient resthighlevelclient