Asynchronous Reindex request in ElasticSearch 6.3 is not working

Hello Guys,
I have been trying this code

 ReindexRequestBuilder builder = ReindexAction.INSTANCE.newRequestBuilder(getClient())
                .source(sourceIndexName).abortOnVersionConflict(false)
                .destination(destinationIndexName);

        builder.destination().setOpType(DocWriteRequest.OpType.CREATE);
        builder.abortOnVersionConflict(false);
        BulkByScrollResponse response = builder.get();

        System.out.println("Task is in process");

Actually I wanted to run this reindex task Asynchronously, I have gone through the docs also in the latest version we can see reindex has different methods for synchronous and asynchronous, but as I am using ElasticSearch 6.3 you can see the last line i.e "Task is in process" is getting the control after reindex is complete. Also I need to track this task with TaskApi, but its not possible I am getting empty tasklist.

Can anyone please help.

Thanks in advance.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.