itemsapi / itemsjs

Extremely fast faceted search engine in JavaScript - lightweight, flexible, and simple to use
Apache License 2.0
350 stars 41 forks source link

Hide empty filters through configuration #117

Closed mulquin closed 2 years ago

mulquin commented 2 years ago

This implements the second idea in #39. This PR adds the hide_zero_doc_count configuration value on aggregations that if set to true will exclude filters with 0 results.

cigolpl commented 2 years ago

Thanks! This can be get by new version itemsjs@2.1.20

SergeyRe commented 2 years ago

thanks for adding this feature the only thing prevents using it : i show selected facet value always (even it has zero doc_count) reasons: to show user his choice made and to give possibility to cancel it I think it will be great to have option to hide all zero doc_count facet values but selected