Elasticsearch聚合过滤器 [英] Elasticsearch filter on aggregation
问题描述
由于我在Google上找不到任何东西,所以:
Since I couldn't find anything on Google:
是否有可能对Elasticsearch中的聚合进行过滤。我想到的东西是:获取SUM(obect.X)> 100的所有对象。
Is it possible to filter on an aggregation in elasticsearch. Im thinking of someting like: Get all objects where SUM(obect.X) > 100.
预先感谢。
编辑-样本数据
我具有以下文档结构:
{
docKey : 1
value: 2
},
{
docKey: 1
value: 5
},
{
docKey:1
value: 7
},
{
docKey:2
value:2
},...
我现在要从数据库中查询docKey
I now want to query the docKey from the database where the sum of the value is bigger than X.
EDIT2
我发现这是我在应用程序逻辑中必须要做的事情。
您可以看到它这里
I found out that is something I have to do in my application logic. you can see it here
推荐答案
这并不能完全回答您的问题,但是您看到的是模糊的意思,即没有发布映射,查询或其他任何我们无法帮助您的问题。不过,我希望您能够通过这篇很棒的文章自己解决问题在聚合上。祝你好运。
This doesn't exactly answer your question but seeing as you were pretty vague i.e. posting no mapping, query or anything of that matter we can't help you. However I hope you'll be able to work it out for yourself with this fantastic article on aggregations. Best of luck.
更新-也许这是您要找的?
Update - Maybe this is what you're looking for instead?
这篇关于Elasticsearch聚合过滤器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!