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

标签 elasticsearch elasticsearch-5

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

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

关于elasticsearch - 使用新映射更新 Elasticsearch 5.6 索引类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56429467/

相关文章:

elasticsearch - 使用数据库中50个表中的数据创建一个kibana仪表板

elasticsearch - Elasticsearch Reindex API部分更新

Python elasticsearch.helpers.scan 示例

amazon-web-services - 无法使用Terraform为ElasticSearch添加2个子网

.net - ElasticSearch NEST 检查空值

java - elasticsearch如何存储数据

elasticsearch - 在Elasticsearch中使用Levenshtein算法进行模糊字符串匹配

elasticsearch - 在elasticsearch中,如何查询日期字段为2020年1月1日太平洋时间的任何时间的所有文档

elasticsearch - 请求在Elasticsearch中通过ID失败删除记录?

elasticsearch - ElasticSearch无法在其中包含撇号的关键字字段上返回结果