mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-22 19:13:10 +08:00
Do not panic when the facet string is not found
This commit is contained in:
parent
145fa3a8ff
commit
024e06f7e3
@ -219,12 +219,19 @@ impl<'a> FacetDistribution<'a> {
|
|||||||
let facet_key = StrRefCodec::bytes_decode(facet_key).unwrap();
|
let facet_key = StrRefCodec::bytes_decode(facet_key).unwrap();
|
||||||
|
|
||||||
let key: (FieldId, _, &str) = (field_id, any_docid, facet_key);
|
let key: (FieldId, _, &str) = (field_id, any_docid, facet_key);
|
||||||
let original_string = self
|
let optional_original_string =
|
||||||
.index
|
self.index.field_id_docid_facet_strings.get(self.rtxn, &key)?;
|
||||||
.field_id_docid_facet_strings
|
|
||||||
.get(self.rtxn, &key)?
|
let original_string = match optional_original_string {
|
||||||
.unwrap()
|
Some(original_string) => original_string.to_owned(),
|
||||||
.to_owned();
|
None => {
|
||||||
|
tracing::error!(
|
||||||
|
"Missing original facet string. Using the normalized facet {} instead",
|
||||||
|
facet_key
|
||||||
|
);
|
||||||
|
facet_key.to_string()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
distribution.insert(original_string, nbr_docids);
|
distribution.insert(original_string, nbr_docids);
|
||||||
if distribution.len() == self.max_values_per_facet {
|
if distribution.len() == self.max_values_per_facet {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user