我想向我已有的索引添加一个新的映射,我正在尝试使用
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/