index_document.py 文件源码

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

项目:data-store 作者: HumanCellAtlas 项目源码 文件源码
def remove_versions(self, versions: typing.MutableMapping[str, str]):
        """
        Remove this document from each given index provided that it contains the given version of this document.
        """
        es_client = ElasticsearchClient.get(self.logger)
        num_ok, errors = bulk(es_client, raise_on_error=False, actions=[{
            '_op_type': 'delete',
            '_index': index_name,
            '_type': ESDocType.doc.name,
            '_version': version,
            '_id': str(self.fqid),
        } for index_name, version in versions.items()])
        for item in errors:
            self.logger.warning(f"Document deletion failed: {json.dumps(item)}")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号