python - 如何获得 Elasticsearch 页面增量元素

标签 python elasticsearch

我有查询要从 flex 搜索中获取数据

result = es.search(index="my_index", body={"size": 1000, "query": {"match_all": {}}})
print (result)
一口气我带走了所有要素
但是我需要继续增加,比如说10到20、20到30这样的大小

最佳答案

使用from参数:

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

关于python - 如何获得 Elasticsearch 页面增量元素,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63635144/

相关文章:

elasticsearch - 字词聚合(以实现分层构面)查询性能较慢

elasticsearch - 仅删除所有文档中符合我的条件的字段

amazon-web-services - FIlebeat-Redis-Logstash : Filebeat fast and Logstah slow, logstash 线程?

python - 列表追加重置递归函数中的列表

elasticsearch 巢 : get TopHits result directly without using bucket. TopHits()

python - Python 和 GO 之间的通信媒介?

python : Trying to concatenate a simple string into a URL

elasticsearch - Elasticsearch在索引模板中使用两个映射引发错误

python - 没有名为 numpy 的模块

python - django objects.filter 对于同一关键字有 2 个条件,其中任何一个都匹配