如何获取elasticsearch页面增量元素

我有查询从弹性搜索中获取数据

result = es.search(index="my_index", body={"size": 1000, "query": {"match_all": {}}})
print (result)

我一次就把所有元素都带来了

但我需要不断增加尺寸,比如 10 到 20、20 到 30


LEATH
浏览 145回答 1
1回答

杨魅力

使用from参数:result = es.search(index="my_index",&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;body={&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"from": 10,&nbsp; &nbsp; &nbsp;# <---------&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"size": 10,&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;"query": {"match_all": {}}&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;})
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python