Skip to content
Advertisement

Is there a way to use tqdm (progress bar) with ElasticSearch bulk upload?

As the heading states, I’m looking for a nice visual way to check my ES client upload

I can either use:

JavaScript

but I want to use the recommended (by ES) way:

JavaScript

Advertisement

Answer

Yes, but instead of using bulk, you need to use streaming_bulk. Unlike bulk, which only returns the final result in the end, streaming_bulk yields results per action. With this, we can update tqdm after each action.

The code looks more or less like this:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement