我有以下代码:
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/