如何获取ElasticSearch页面增量元素

ygya80vv  于 2021-06-15  发布在  ElasticSearch
关注(0)|答案(1)|浏览(240)

我要从ElasticSearch中获取数据

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

我一枪就把所有的元素都带来了
但我需要不断增加,比如说10到20码,20到30码

tjjdgumg

tjjdgumg1#

使用 from 参数:

result = es.search(index="my_index",
                   body={
                       "from": 10,     # <---------
                       "size": 10,
                       "query": {"match_all": {}}
                   })

相关问题