Fixes #1237 using bulk api in elasticsearch