Return facets even when there is no values associated to it

This commit is contained in:
Kerollmops 2022-04-26 17:59:53 +02:00
parent 2fdf520271
commit 7d1c2d97bf
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -243,11 +243,9 @@ impl<'a> FacetDistribution<'a> {
for (fid, name) in fields_ids_map.iter() { for (fid, name) in fields_ids_map.iter() {
if crate::is_faceted(name, &fields) { if crate::is_faceted(name, &fields) {
let values = self.facet_values(fid)?; let values = self.facet_values(fid)?;
if !values.is_empty() {
distribution.insert(name.to_string(), values); distribution.insert(name.to_string(), values);
} }
} }
}
Ok(distribution) Ok(distribution)
} }