下面的代码:
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]')
在扫描函数中应该如何传递切片参数?
2条答案
按热度按时间slsn1g291#
根据我的经验,“max”需要〉1。我以前在使用“max”时也看到过同样的错误:1。
jjhzyzn02#
HTTP API的原始错误显示
max
必须大于1。