diff --git a/milli/src/search/mod.rs b/milli/src/search/mod.rs index 77f9ce0b8..114ca2a04 100644 --- a/milli/src/search/mod.rs +++ b/milli/src/search/mod.rs @@ -3,6 +3,7 @@ use std::fmt; use fst::automaton::{Complement, Intersection, StartsWith, Str, Union}; use fst::Streamer; use levenshtein_automata::{LevenshteinAutomatonBuilder as LevBuilder, DFA}; +use log::{debug, error}; use once_cell::sync::Lazy; use roaring::bitmap::RoaringBitmap; @@ -306,7 +307,10 @@ impl<'a> SearchForFacetValues<'a> { let key = FacetGroupKey { field_id: fid, level: 0, left_bound: value }; let docids = match index.facet_id_string_docids.get(rtxn, &key)? { Some(FacetGroupValue { bitmap, .. }) => bitmap, - None => todo!("return an internal error"), + None => { + error!("the facet value is missing from the facet database: {key:?}"); + continue; + } }; let count = search_candidates.intersection_len(&docids); if count != 0 { @@ -329,7 +333,10 @@ impl<'a> SearchForFacetValues<'a> { let key = FacetGroupKey { field_id: fid, level: 0, left_bound: value }; let docids = match index.facet_id_string_docids.get(rtxn, &key)? { Some(FacetGroupValue { bitmap, .. }) => bitmap, - None => todo!("return an internal error"), + None => { + error!("the facet value is missing from the facet database: {key:?}"); + continue; + } }; let count = search_candidates.intersection_len(&docids); if count != 0 {