Elasticsearch PUT 插入資料
阿新 • • 發佈:2018-11-07
{ "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