在Elasticsearch中建立索引时使用collections.deque

时间:2019-02-21 08:48:11

标签: python-3.x elasticsearch elasticsearch-py

我一直在关注学习Elasticsearch的教程,并且批量索引指导员使用了类似的方法

from collections import deque
from elasticsearch import helpers
import elasticsearch

def generator_function()
    # code
    yield results

es = elasticsearch.Elasticsearch()
deque(
    helpers.parallel_bulk(
        es,
        readRatings(),
        index="index_name",
        doc_type="_doc",
    ),
    maxlen=0
)
es.indices.refresh()

deque在这里有什么用?

0 个答案:

没有答案
相关问题