I'm trying to implement bulk upload in elasticsearch with node.js.
While uploading data I'm facing errors like:
"error": {
"type": "mapper_parsing_exception",
"reason": "failed to parse field [_id] of type [_id] in document with id 'id'. Preview of field's value: 'id'"
}
My sample code as below
const result = elastic_client.bulk({
body: [{
index: {
_index: indexName,
_id: "62c13eeac784c2753c0ca4a0"
},
_type: "62c13eeac784c2753c0ca4a0 } {
"firstName": "Paul",
"lastName": "Deo",
"gender": "Male"
}]
}, function (err, resp) {
if (resp) {
console.log(JSON.stringify(resp, null, '\t'));
}
if (err) {
console.log(err, "err>>>>>>>>>>>>>>>>>>>>>>>");
}
});