我正在使用Elasticsearch [版本6.4.0]。我正在尝试将一个简单的客户文档编入客户索引。我的查询是
passport.serializeUser(function(user, done) {
let sessionUser = {
username: user.sAMAccountName,
sessionID: user.sessionID
};
done(null, sessionUser);
});
passport.deserializeUser(function(user, done) {
Session.findOne({where: {sid: user.sessionID}}).then(user => {
return done(null, user);
});
});
curl -X PUT "localhost:9200/customer/_doc/1?pretty" -H "Content-Type: application/json" -d'
{
"name": "John Doe"
}
'
答案 0 :(得分:0)
尝试:
curl -XPOST http://localhost:9200/customer/_doc -d '{"name":"John Doe"}' -H 'Content-Type: application/json'
答案 1 :(得分:-1)
使用以下命令。
curl -H "Content-Type: application/json" -X PUT localhost:9200/customer/_doc/1?pretty -d "{\\"Name\\":\\"John Doe\\"}"