Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/json/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python elasticsearch.helpers.scan示例 - Fatal编程技术网

Python elasticsearch.helpers.scan示例

Python elasticsearch.helpers.scan示例,
Warning: implode(): Invalid arguments passed in /data/phpspider/zhask/webroot/tpl/detail.html on line 45
,,有人能提供python elasticsearch helpers客户端的扫描API示例吗 res = elasticsearch.helpers.scan(....) 如何使用res对象获取elasticsearch的所有结果?包括一个示例,不过如果我阅读正确,helpers.scan默认设置search\u type=scan,这是一个错误。这会导致示例代码失败,ES返回[scan]无搜索类型。我们可以用preserve\u order=True来修改这一点(但我不确定此处的性能影响):

有人能提供python elasticsearch helpers客户端的扫描API示例吗

res = elasticsearch.helpers.scan(....)
如何使用res对象获取elasticsearch的所有结果?

包括一个示例,不过如果我阅读正确,
helpers.scan
默认设置
search\u type=scan
,这是一个错误。这会导致示例代码失败,ES返回[scan]无搜索类型。我们可以用
preserve\u order=True
来修改这一点(但我不确定此处的性能影响):

这个助手返回一个对象,您可以迭代该对象以从查询中获得实际结果

项的形式为

{'_index': <str>, '_type': <str>, '_id': <str>, '_score': <float or None>, '_source': {'key': val}, 'sort': [<int>]}
{'u index':,'u type':,'u id':,'u score':,'u source':{'key':val},'sort':[]}

属性错误:模块“elasticsearch”没有属性“helpers”
??@keithpjolley是的,谢谢,修复了。那个错误信息可能会少一点误导性。。。
{'_index': <str>, '_type': <str>, '_id': <str>, '_score': <float or None>, '_source': {'key': val}, 'sort': [<int>]}