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.
> But make sure first that you are upgrading to the latest version of the JS client
NEW: Monitor These Apps!
Apache Lucene, Apache Solr and all other Apache Software Foundation project and their respective logos are trademarks of the Apache Software Foundation.
Elasticsearch, Kibana, Logstash, and Beats are trademarks of Elasticsearch BV, registered in the U.S. and in other countries. This site and Sematext Group is in no way affiliated with Elasticsearch BV.
Service operated by Sematext