david lopez david lopez - 4 months ago 11
Node.js Question

nodejs elastic client getMapping don't give mapp

I don't have Success to get the map of the index by

client.indices.getMapping([params, [callback]])


the function does reach the call back. I do it this way:

client.indices.getMapping({index: 'patents'}, function(error, response) {
if (error) {
console.log(error);
} else {
console.log(response);
}
});

Answer

Try for this:

client.indices.getMapping({
index: "indexname",
type:"type"
}, function (error, response) {
if(error){   
logger.error(error);
})