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

Updating Elasticsearch 5.6 index type with new mapping

我想添加一个新的映射到我已有的索引,我正在尝试

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"
   }
 }
'

但它正在返回

{"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}%

我真的不知道这是什么意思...

有人可以帮忙吗?

您的 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"
     }
   }
  }
}'