We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Below are the libraries I am using. implementation group: 'org.springframework.data', name: 'spring-data-elasticsearch', version: '5.1.12' implementation group: 'org.elasticsearch.client', name: 'elasticsearch-rest-client', version: '8.6.2'
Below is my code snippet.
private void executeEnrichPolicy(ElasticsearchEnrichClient enrichClient, String policyName) throws IOException { log.info("executing:{}", policyName); ApiTypeHelper.DANGEROUS_disableRequiredPropertiesCheck(true); ExecutePolicyRequest executePolicyRequest = ExecutePolicyRequest.of(e -> e.name(policyName). waitForCompletion(false)); final ExecutePolicyResponse executePolicyResponse = enrichClient.executePolicy(executePolicyRequest); String taskId = executePolicyResponse.taskId(); pollForTaskCompletion(taskId); ApiTypeHelper.DANGEROUS_disableRequiredPropertiesCheck(false); log.info("policy executed:{}", executePolicyResponse.status().toString()); } @SneakyThrows private void pollForTaskCompletion(String taskId) { ElasticsearchTasksClient tasksClient = restHighLevelClient.tasks(); while (true) { GetTasksRequest getTasksRequest = GetTasksRequest.of(builder -> builder.taskId(taskId)); GetTasksResponse getTasksResponse = tasksClient.get(getTasksRequest); if (getTasksResponse.task() == null) { log.info("Task completed: {}", taskId); break; } else { log.info("Task {} is still running.", taskId); } Thread.sleep(60000); } }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Below are the libraries I am using.
implementation group: 'org.springframework.data', name: 'spring-data-elasticsearch', version: '5.1.12'
implementation group: 'org.elasticsearch.client', name: 'elasticsearch-rest-client', version: '8.6.2'
Below is my code snippet.
The text was updated successfully, but these errors were encountered: