How do I get to know that reindexing has been completed in Elasticsearch python client?

Basically, I'm running a reindexing function, and immediately after that, I'm running a function to delete the source index. Python runs all lines of code for the first function and moves to the next function (delete index).

Sometimes the reindexing isn't performed and the source index gets deleted, causing data loss.

I want to add either a Boolean field or any sort of flag that indicates that reindexing has been completed so that I can move on with the delete function.

Hi @Aditya_Dubey

If you are using the Reindex API you can use the parameter wait_for_completion = false to run async and receive a taks id.

With this task id you can check whether the reindexing has finished and thus perform the operation to remove the index.

1 Like

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