首页 > 编程知识 正文

es重建索引,elasticsearch 自动创建索引

时间:2023-05-05 13:31:11 阅读:194405 作者:384

当执行

curl -X PUT '9.112.4.34:9200/accounts/person/1' -d '
{
  "user": "潇洒的御姐",
  "title": "工程师",
  "desc": "数据库管理"
}'

报错:{"error":"Content-Type header [application/x-www-form-urlencoded] is not supported","status":406} 

curl -H 'Content-Type:application/json' -X PUT '9.112.4.34:9200/accounts/person/1' -d '
{
  "user": "潇洒的御姐",
  "title": "工程师",
  "desc": "数据库管理"
}'

是由于ES在6.x后做了调整,具体信息查看官网:https://www.elastic.co/blog/strict-content-type-checking-for-elasticsearch-rest-requests

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。