關於Elasticsearch6.0.0遇到的問題


No.1

環境CentOS7 64bit

  初次安裝Elasticsearch以后,按照教程指導,在操作:

  curl -XPUT 'localhost:9200/customer/external/1?pretty' -d '
  {
    "name": "Jimmy Yankee"
  }'

  (Customer是之前添加的索引)

  提示報錯,如下:

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

解決方案:

  在原指令中,添加:-H 'Content-Type: application/json'

既:

  curl -XPUT 'localhost:9200/customer/external/1?pretty' -H 'Content-Type: application/json' -d '

  {
    "name": "Jimmy Yankee"
  }

問題解決~


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM