简体   繁体   English

使用聚合而不是方面的弹性搜索

[英]Elastic search using aggregations instead of facets

I am trying to figure out how I would do the following query, but instead of using facets use the new aggregation.我试图弄清楚我将如何执行以下查询,但不是使用方面,而是使用新的聚合。 The reason for my change is then I would like to take it further and instead of just showing 10 tags, show all tags with a count over 0.我更改的原因是我想更进一步,而不是只显示 10 个标签,而是显示计数超过 0 的所有标签。

{
    "query" : { "query_string" : {"query" : "T*"} },
    "facets" : {
      "tags" : { "terms" : {"field" : "tags"} }
    }
}

Any help would be greatly appreciated任何帮助将不胜感激

Most facet types have an equivalent aggregation type.大多数方面类型具有等效的聚合类型。 The equivalent of the terms facet type is the terms aggregation type . terms方面类型的等价物是terms聚合类型

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM