ElasticSearch 导入索引时报错 Rejecting mapping update to [xxx] as the final mapping would have more than 1 type: [xxx, xxx]

19-08-06 19:02 字数 657 阅读 3547

尝试在一个 ElasticSearch 的 index 中导入多个 type 时报错,报错信息如下:

[responseCode] => 400
    [responseHeaders] => Array
        (
            [content-type] => application/json; charset=UTF-8
            [content-length] => 355
        )

    [responseBody] => Array
        (
            [error] => Array
                (
                    [root_cause] => Array
                        (
                            [0] => Array
                                (
                                    [type] => illegal_argument_exception
                                    [reason] => Rejecting mapping update to [shiqidu] as the final mapping would have more than 1 type: [discussion, article]
                                )

                        )

                    [type] => illegal_argument_exception
                    [reason] => Rejecting mapping update to [shiqidu] as the final mapping would have more than 1 type: [discussion, article]
                )

            [status] => 400
        )

原因:6.0的版本不允许一个 index 下面有多个 type,并且官方说是在接下来的7.0版本中会删掉 type ,官方说明 ,搞得有点迷,看一些文章说 ElasticSearch 的 index 相当于 数据库type 相当于 数据表,但是现在看来,如果要储存多个表的数据,还是得建立多个 index 索引。

0人点赞>
关注 收藏 改进 举报
0 条评论
排序方式 时间 投票
快来抢占一楼吧
请登录后发表评论
站长 @ 十七度
文章
380
粉丝
23
喜欢
190
收藏
31
排名 : 1
访问 : 127.82万
私信