How do we include the stack trace of the error on the JavaScript client? The API says error_trace
is an accepted common parameter, but I couldn't get the complete stack trace of the error* I was troubleshooting :
var client = new elasticsearch.Client({
host: 'localhost:9200',
log: [{ level: 'error', type: 'stdio' },
{ level: 'debug', type: 'file', path: '...'}],
//...
apiVersion: "5.6"
});
client.bulk({ body: [/*...*/], error_trace: true}, function(err, resp){
if(resp.errors) {
console.log(resp.items[0].index.error);
//Prints {type: "mapper_parsing_exception",
//reason: "unknown parameter [ignore_malformed] on mapper [mykeyword]
//of type [keyword]"}
}
});
*this refers to the Ignore_malformed fires mapper_parsing_exception for keyword type issue