If you forget to pass any documents to bulk_index, raise ValueError rather than ElasticSearchError.
If you forget to pass any documents to bulk_index, raise ValueError rather than ElasticSearchError.

This is a programming error, and it should be loud. It's not unlikely you're catching ElasticSearchError to sniff out server errors in a bulk-indexing loop, and you wouldn't want to catch bad uses of bulk_index inadvertently.
erikrose/pyelasticsearch