elastic.py 文件源码

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

项目:sigir2017-table 作者: iai-group 项目源码 文件源码
def add_docs_bulk(self, docs):
        """Adds a set of documents to the index in a bulk.

        :param docs: dictionary {doc_id: doc}
        """
        actions = []
        for doc_id, doc in docs.items():
            action = {
                "_index": self.__index_name,
                "_type": self.DOC_TYPE,
                "_id": doc_id,
                "_source": doc
            }
            actions.append(action)

        if len(actions) > 0:
            helpers.bulk(self.__es, actions)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号