python - 使用切片扫描elasticsearch中的python助手

标签 python elasticsearch

我有以下代码:

client = Elasticsearch(hosts=['host'], port=9200)
scan_arguments = {'query': {'slice': {'max': 1, 'id': 0}}, 'preference': '_shards:0', 'index': u'my_index'}

for hit in scan(client, **scan_args):
    # do something with hit

我收到以下错误

RequestError: TransportError(400, u'parsing_exception', u'[slice] failed to parse field [max]')

scan函数中slice参数应该如何传递?

最佳答案

根据我的经验,“max”需要 >1。我之前在使用 "max":1 时看到了同样的错误。

关于python - 使用切片扫描elasticsearch中的python助手,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48988359/

相关文章:

python - 为什么应用程序和小部件之间没有引用?

python - 使用 xarray + dask 的内存错误 - 使用 groupby 或 apply_ufunc?

java - 从 @ResponseBody 返回 JSONArray 时抛出错误

elasticsearch - ElasticSearch Kibana bin文件夹没有plugin.bat

elasticsearch - 在 ElasticSearch 中使用分析器进行部分搜索

python - 将 df 列中的值转换为 True/False

python - 在python中过滤列表获取整数

python - 使用正则表达式从电子邮件 header 中查找 IP 地址

java - Spring Boot 中可以有多个传输客户端吗?

search - elasticsearch按范围查询日期