Add unit tests for Elasticsearch batch search + fix FindBugs issues