Elasticsearch 聚合限制
当我创建聚合查询时,它适用于什么范围:索引中的所有条目还是仅前 10000 个条目? 例如,以下是我得到的脚本指标聚合响应:
{
"took": 76,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 10000,
"relation": "gte"
},
"max_score": null,
"hits": []
},
"aggregations": {
"number_of_operations_in_progress": {
"value": 2
}
}
}
hits->total->value is 10000 这让我认为聚合函数仅应用于前 10000 个条目,而不是索引中的整个数据集。
我的理解正确吗?如果是,有没有办法将聚合函数应用于所有条目?
When I create an aggregate query what scope it is applied to: all entries in an index or just first 10000?
For example, here is a response I got for a script metric aggregation:
{
"took": 76,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 10000,
"relation": "gte"
},
"max_score": null,
"hits": []
},
"aggregations": {
"number_of_operations_in_progress": {
"value": 2
}
}
}
hits->total->value is 10000 what makes me think that the aggregate function is applied to first 10000 entries only, not the whole data set in the index.
Is my understanding correct? If yes, is there a way to apply an aggregate function to all entries?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
聚合始终应用于查询选择的整个文档集。
hits.total.value
仅提示有多少文档与查询匹配,在本例中超过 10K 文档与查询匹配。Aggregations are always applied to the whole document set that is selected by the query.
hits.total.value
only gives a hint at how many documents match the query, in this case more than 10K documents match the query.您可以使用
track_total_hits
来控制如何跟踪点击总数you can usr
track_total_hits
to control how the total number of hits should be tracked