【问题标题】:Updating Elasticsearch 5.6 index type with new mapping使用新映射更新 Elasticsearch 5.6 索引类型
【发布时间】:2019-06-03 14:31:49
【问题描述】:

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

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

我真的不知道这意味着什么......

有人可以帮忙吗?

【问题讨论】:

    标签: elasticsearch elasticsearch-5


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2017-03-11
      • 2015-02-02
      • 2019-04-16
      • 1970-01-01
      • 2018-08-24
      • 2015-04-07
      • 2020-06-28
      • 1970-01-01
      • 2017-10-08
      相关资源
      最近更新 更多