Elasticsearch 6.2.3版本 同一個index新增type報錯 Rejecting mapping update to [website] as the final mapping would have more than 1 type: [blog2, blog]


在website的index下已經存在一個名為blog的type。想在website下,新增一個名為blog2的type。

執行語句如下:

PUT /website/blog2/1
{
  "title": "My first blog entry",
  "text":  "Just trying this out...",
  "date":  "2014/01/01"
}

 

報錯信息如下:

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Rejecting mapping update to [website] as the final mapping would have more than 1 type: [blog2, blog]"
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Rejecting mapping update to [website] as the final mapping would have more than 1 type: [blog2, blog]"
  },
  "status": 400
}

 

原因:Elasticsearch 在6.0版本以后一個index下,只允許創建一個type,不允許存在多個type。並且在官網提供信息,7.0以后不再使用type。


免責聲明!

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



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