def update_docs(self, partial_docs, **kwargs):
index_name = self.ES_INDEX_NAME
doc_type = self.ES_INDEX_TYPE
def _get_bulk(doc):
doc = {
'_op_type': 'update',
"_index": index_name,
"_type": doc_type,
"_id": doc['_id'],
"doc": doc
}
return doc
actions = (_get_bulk(doc) for doc in partial_docs)
return helpers.bulk(self.conn, actions, chunk_size=self.step, **kwargs)
评论列表
文章目录