The old version of elasticsearch.js is sending requests with application/x-ldjson which not supported by newer elasticsearch versions.
This issue got resolved after editing the package.json of node-elasticsearch-tutorial project in my local. The version of elasticsearch.js mentioned as 11.0.1 where as the latest one available is 14.0.0.
This brings me the latest version of elasticsearch.js from "npm install elasticsearch".
I am now able to index successfully using the bulk function.