Mapper_parsing_exception:只能在某些xcontent字节或压缩的xcontent字节上调用压缩器检测

时间:2018-09-04 18:52:01

标签: elasticsearch

我正在使用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"
}
'

2 个答案:

答案 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\\"}"