Documentation for Elasticsearch Bulk API says that requests should carry the Content-Type: application/x-ndjson header.
I also observed that Elasticsearch was rejecting some of my updates with a The bulk request must be terminated by a newline error, which was caused by Searchyll not sending data in binary mode. Adding .force_encoding('ascii-8bit') solved the issue for me.
I also noticed that Searchyll was sending empty requests to the Bulk API, which caused an error by Elasticsearch. This PR prevents such empty requests.
Documentation for Elasticsearch Bulk API says that requests should carry the
Content-Type: application/x-ndjson
header.I also observed that Elasticsearch was rejecting some of my updates with a
The bulk request must be terminated by a newline
error, which was caused by Searchyll not sending data in binary mode. Adding.force_encoding('ascii-8bit')
solved the issue for me.I also noticed that Searchyll was sending empty requests to the Bulk API, which caused an error by Elasticsearch. This PR prevents such empty requests.