弹性搜索扫描响应中的无限循环

时间:2015-12-22 16:45:49

标签: python elasticsearch generator

我正在使用python客户端在ES上进行非常简单的扫描搜索。出于某种原因,结果集将进入无限循环。有人可以帮忙吗?

# import
from elasticsearch import Elasticsearch
from elasticsearch.helpers import scan

es = Elasticsearch()
es.indices.create(index="analytics", ignore=400)

query = { "query": { "match_all": {} } }

result = scan(client=es, query=query, index="keywords", doc_type="eyelytics", scroll="1m")

# It goes into infinite loop here
for r in result:
    print(r) 
    # print(result)

0 个答案:

没有答案