說明:
1、elasticsearch 版本 6.3.1
2、在同一個index下創建兩個type時報錯,信息如下:
在創建第二個type:solr時,先前已經在相同索引下創建了一個type:es
[root@master ~]# curl -H "Content-Type: application/json" -XPOST 'localhost:9200/books/solr/1?pretty' -d '{"title":"Apache Solr 4 Cookbook", > "published": 2012}' { "error" : { "root_cause" : [ { "type" : "illegal_argument_exception", "reason" : "Rejecting mapping update to [books] as the final mapping would have more than 1 type: [solr, es]" } ], "type" : "illegal_argument_exception", "reason" : "Rejecting mapping update to [books] as the final mapping would have more than 1 type: [solr, es]" }, "status" : 400 }
3、原因
是由於6.0的版本不允許一個index下面有多個type,並且官方說是在接下來的7.0版本中會刪掉type