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?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…