简体   繁体   English

在elasticsearch查询中获取所有匹配的方面

[英]fetch all matching facets in elasticsearch query

Is there are way to fetch all matching facets in elasticsearch query. 有没有办法在Elasticsearch查询中获取所有匹配的方面。 According to the link given here: http://www.elasticsearch.org/guide/reference/api/search/facets/terms-facet/ it is possible to get the facet which N size. 根据此处提供的链接: http : //www.elasticsearch.org/guide/reference/api/search/facets/terms-facet/可以得到N尺寸的小平面。 But what if I want to get all matching facets? 但是,如果我想获得所有匹配的方面怎么办?

I tried specifying "size: 0" in my facet query, but that didn't seem to work. 我尝试在我的方面查询中指定“ size:0”,但这似乎不起作用。

Here is my sample ES query 这是我的示例ES查询

query: {
    ..
}
facets: {
    company: {
        terms: {
            field: "company"
            size: N
        }
    }
}

In short. 简而言之。 You can't. 你不能

See open issue: https://github.com/elasticsearch/elasticsearch/issues/1776 参见公开问题: https : //github.com/elasticsearch/elasticsearch/issues/1776

workaround: specify N to be very large so everything is contained. 解决方法:将N指定为非常大,以便包含所有内容。

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

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