I'm trying to create an elasticsearch index with mappings using the official javascript client.
My code is as follows:
client.indices.create({
index: "aName",
"mappings": {
"aType": {
"properties": {
"aProp1": { "type": "string", "index": "not_analyzed" },
"aProp2": { "type": "string", "index": "not_analyzed" },
"aProp3": { "type": "string", "index": "not_analyzed" },
"aProp4": { "type": "string", "index": "not_analyzed" }
}
}
}
}, function(err,resp,respcode){
console.log(err,resp,respcode);
});
However... the index is created but without the mappings.... The output is:
undefined { ok: true, acknowledged: true } 200
What am I doing wrong?
http://<host>:<port>/aName/_mapping/aType
?