elasticsearch.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:jx-sqlite 作者: mozilla 项目源码 文件源码
def _merge_mapping(a, b):
    """
    MERGE TWO MAPPINGS, a TAKES PRECEDENCE
    """
    for name, b_details in b.items():
        a_details = a[literal_field(name)]
        if a_details.properties and not a_details.type:
            a_details.type = "object"
        if b_details.properties and not b_details.type:
            b_details.type = "object"

        if a_details:
            a_details.type = _merge_type[a_details.type][b_details.type]

            if b_details.type in ES_STRUCT:
                _merge_mapping(a_details.properties, b_details.properties)
        else:
            a[literal_field(name)] = deepcopy(b_details)

    return a
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号