Is there any package available to write the elasticsearch documents in bulk (more than 2 million) to a csv?

Is there any package available to write the elasticsearch documents in bulk (more than 2 million) to a csv?
Cannot find any package for this surprisingly.

You should be able to use Logstash for this. Use an elasticsearch input and a file output.