聚合查询


The aggregations API allows grouping by multiple fields, using  sub-aggregations . Suppose you want to group by fields  field1 field2  and  field3 :
{ "aggs" : { "agg1" : { "terms" : { "field" : "field1" }, "aggs" : { "agg2" : { "terms" : { "field" : "field2" }, "aggs" : { "agg3" : { "terms" : { "field" : "field3" } } } } } } } }
Of course this can go on for as many fields as you'd like.
聚合API允许通过多个域的分组,使用 子聚合 。假设你想组的领域 field1 field2 field3
{ "aggs" : { "agg1" : { "terms" : { "field" : "field1" }, "aggs" : { "agg2" : { "terms" : { "field" : "field2" }, "aggs" : { "agg3" : { "terms" : { "field" : "field3" } } } } } } } }
当然,这可能会为你会像许多领域。

你可能感兴趣的:(elasticsearch)