作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我一直在尝试在Elasticsearch术语聚合中添加分页。在查询中,我们可以添加分页,例如
{
"from": 0, // to add the start to control the pagination
"size": 10,
"query": { }
}
{
"from": 0,
"size": 0,
"aggs": {
"group_by_name": {
"terms": {
"field": "name",
"size": 20
},
"aggs": {
"top_tag_hits": {
"top_hits": {
"size": 1
}
}
}
}
}
}
最佳答案
好像您可能想要分区。 From the docs:
Sometimes there are too many unique terms to process in a single request/response pair so it can be useful to break the analysis up into multiple requests. This can be achieved by grouping the field’s values into a number of partitions at query-time and processing only one partition in each request.
"include": { "partition": n, "num_partitions": x },
,其中
n
是页面,而
x
是页面数。
关于elasticsearch - 如何使用From/Size控制Elasticsearch聚合结果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43038131/
我是一名优秀的程序员,十分优秀!