Try our conversational search powered by Generative AI!

Facets with 0 Count


Hi All, 

I am using Episerver Find and want to show all Facets, including those with a 0 count. 

I have tried using the AllTerms = true although this seems to limit the number of Facets Items to 10. When using Size = x option when filtering the Facets seems to get filtered out. I cant use AllTerms and Size togeather. 

FilterHits has no effect on the Facets. 

What I am ideally looking for is a way to use AllTerms and Size togeather



May 24, 2018 18:05

In Elastic search there is a setting called minimun_document_count for aggregations (that means facets) (

I do not know if there is any possibility to set that property in Episerver Find and if there were, Elastic warns about setting it to zero

"Setting min_doc_count=0 will also return buckets for terms that didn’t match any hit. However, some of the returned terms which have a document count of zero might only belong to deleted documents or documents from other types, so there is no warranty that a match_all query would find a positive document count for those terms."

Why do you want to show facets with 0 count?

May 25, 2018 8:16

This is due to the design we want to show Facet [0]. I have a complete list of terms from another method and will rebuild my list on this now as it seems the only real way. Rather than using AllTerms=true I will need to use Size = 100

Thanks Anyway


May 25, 2018 11:07

Good luck

May 25, 2018 13:05

This should do the trick:

   .TermsFacetFor(x => x.MyProperty, facet =>
                    facet.Size = 100;
                    facet.AllTerms = true;
May 27, 2018 23:39

Per Magne, so AllTerms is the same as minimun_document_count = 0 in elastic?

May 28, 2018 10:50

Basically. "all_terms" is used by facets in elasticsearch, which has been replaced by aggregation in newer versions of elasticsearch.

May 28, 2018 11:27

Thank you Per Magne, will try your solution shortly, will let you know how I get on. 

May 28, 2018 11:36
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.