Elasticsearch PUT 插入數據


{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "unknown setting [index.atype_id] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "unknown setting [index.atype_id] please check that any required plugins are installed, or check the breaking changes documentation for removed settings",
    "suppressed": [
      {
        "type": "illegal_argument_exception",
        "reason": "unknown setting [index.id] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      },
      {
        "type": "illegal_argument_exception",
        "reason": "unknown setting [index.name] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      },
      {
        "type": "illegal_argument_exception",
        "reason": "unknown setting [index.package] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      },
      {
        "type": "illegal_argument_exception",
        "reason": "unknown setting [index.rank] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      },
      {
        "type": "illegal_argument_exception",
        "reason": "unknown setting [index.state] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      },
      {
        "type": "illegal_argument_exception",
        "reason": "unknown setting [index.status] please check that any required plugins are installed, or check the breaking changes documentation for removed settings"
      }
    ]
  },
  "status": 400
}

當出現   illegal_argument_exception 時候 意思是非法參數異常。也就是URI 缺少參數。在創建Elasticsearch的index 有一個 type (也就是Mysql數據中的表名), 在curl的時候沒有輸入這個type的話

就會報錯

unknown setting [index.status] please check that any required plugins are installed, or check the breaking changes documentation for removed settings出現這個錯誤,這個錯誤就說明 你在插入數據的時候 不知道你要把你的這條數據插入到哪個表里面去,所以就報錯了。類似於Mysql 因為要指定一張表的插入,不能隨便插入不是。。。。

 

所以 正確的方法 URL 是

curl -H "Content-Type: application/json" -X PUT 'http://localhost:9200/index/type' -d

 

  

 

 

 

  

 


免責聲明!

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



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