518: Return facets even when there is no value associated to it r=Kerollmops a=Kerollmops

This PR is related to https://github.com/meilisearch/meilisearch/issues/2352 and should fix the issue when Meilisearch is up-to-date with this PR.

Co-authored-by: Kerollmops <clement@meilisearch.com>
This commit is contained in:
bors[bot] 2022-04-28 09:04:36 +00:00 committed by GitHub
commit 9db86aac51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 79 additions and 3 deletions

View file

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