mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 20:15:07 +08:00
Log an error when a facet value is missing from the database
This commit is contained in:
parent
55c17aa38b
commit
8e86eb91bb
@ -3,6 +3,7 @@ use std::fmt;
|
|||||||
use fst::automaton::{Complement, Intersection, StartsWith, Str, Union};
|
use fst::automaton::{Complement, Intersection, StartsWith, Str, Union};
|
||||||
use fst::Streamer;
|
use fst::Streamer;
|
||||||
use levenshtein_automata::{LevenshteinAutomatonBuilder as LevBuilder, DFA};
|
use levenshtein_automata::{LevenshteinAutomatonBuilder as LevBuilder, DFA};
|
||||||
|
use log::{debug, error};
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use roaring::bitmap::RoaringBitmap;
|
use roaring::bitmap::RoaringBitmap;
|
||||||
|
|
||||||
@ -306,7 +307,10 @@ impl<'a> SearchForFacetValues<'a> {
|
|||||||
let key = FacetGroupKey { field_id: fid, level: 0, left_bound: value };
|
let key = FacetGroupKey { field_id: fid, level: 0, left_bound: value };
|
||||||
let docids = match index.facet_id_string_docids.get(rtxn, &key)? {
|
let docids = match index.facet_id_string_docids.get(rtxn, &key)? {
|
||||||
Some(FacetGroupValue { bitmap, .. }) => bitmap,
|
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);
|
let count = search_candidates.intersection_len(&docids);
|
||||||
if count != 0 {
|
if count != 0 {
|
||||||
@ -329,7 +333,10 @@ impl<'a> SearchForFacetValues<'a> {
|
|||||||
let key = FacetGroupKey { field_id: fid, level: 0, left_bound: value };
|
let key = FacetGroupKey { field_id: fid, level: 0, left_bound: value };
|
||||||
let docids = match index.facet_id_string_docids.get(rtxn, &key)? {
|
let docids = match index.facet_id_string_docids.get(rtxn, &key)? {
|
||||||
Some(FacetGroupValue { bitmap, .. }) => bitmap,
|
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);
|
let count = search_candidates.intersection_len(&docids);
|
||||||
if count != 0 {
|
if count != 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user