0
votes

Is there are way to fetch all matching facets in elasticsearch query. 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. 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.

Here is my sample ES query

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

1 Answers

1
votes

In short. You can't.

See open issue: https://github.com/elasticsearch/elasticsearch/issues/1776

workaround: specify N to be very large so everything is contained.