我们知道,由于连接错误问题,我们无法从弹性搜索中获取超过10000行的python。我想要每隔5分钟从我的弹性丛集中获得两小时的数据,我有大约10000次观察。
1.)如果我可以将弹性搜索中的数据直接转储到csv或者超过10000计数的某个Nosql数据库中,是否有任何方法。
我在python中编写代码。
我有弹性搜索版本5
尝试以下代码进行滚动查询
from elasticsearch import Elasticsearch, helpers
es = Elasticsearch()
es_index = "your_index_name"
documento = "your_doc_type"
body = {
"query": {
"term" : { "user" : user }
}
}
res = helpers.scan(
client = es,
scroll = '2m',
query = body,
index = es_index)