我正在尝试使用官方javascript客户端创建一个带有映射的elasticsearch索引.
我的代码如下:
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);
});
Run Code Online (Sandbox Code Playgroud)
但是...索引已创建但没有映射....输出为:
undefined { ok: true, acknowledged: true } 200
我究竟做错了什么?