简体   繁体   English

使用新映射更新Elasticsearch 5.6索引类型

[英]Updating Elasticsearch 5.6 index type with new mapping

I'd like to add a new mapping to an index I already have, I'm trying with 我想向已有的索引添加新的映射,我正在尝试

curl -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT http://localhost:9200/videos_development/_mapping/video -d '
"video":{
  "properties":{
    "id_lookup":"text"
   }
 }
'

but it's returning 但它回来了

{"error":{"root_cause":[{"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"}],"type":"not_x_content_exception","reason":"Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes"},"status":500}%

and I really have no idea what it means... 我真的不知道这意味着什么...

Can anybody help? 有人可以帮忙吗?

Your JSON is malformed, you need opening and closing curly braces + you're also missing the type in the field definition: 您的JSON格式不正确,您需要打开和关闭花括号,而且在字段定义中也缺少type

curl -H 'Content-Type: application/json' -H 'Accept: application/json' -X PUT http://localhost:9200/videos_development/_mapping/video -d '{
 "video":{
   "properties":{
     "id_lookup": {
       "type": "text"
     }
   }
  }
}'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM