mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-09-06 04:36:32 +00:00
Enable new algorithm every time
This commit is contained in:
@ -427,29 +427,26 @@ impl<'a> Filter<'a> {
|
|||||||
|
|
||||||
let value = crate::normalize_facet(word.value());
|
let value = crate::normalize_facet(word.value());
|
||||||
|
|
||||||
if value.len() <= 6 {
|
let mut value2 = value.as_bytes().to_owned();
|
||||||
// 6 is abitrary, but it works well in practice
|
if let Some(last) = value2.last_mut() {
|
||||||
let mut value2 = value.as_bytes().to_owned();
|
if *last != 255 {
|
||||||
if let Some(last) = value2.last_mut() {
|
*last += 1;
|
||||||
if *last != 255 {
|
if let Ok(value2) = String::from_utf8(value2) {
|
||||||
*last += 1;
|
// The idea here is that "STARTS WITH baba" is the same as "baba <= value < babb".
|
||||||
if let Ok(value2) = String::from_utf8(value2) {
|
// We just increase the last letter to find the upper bound.
|
||||||
// The idea here is that "STARTS WITH baba" is the same as "baba <= value < babb".
|
// The result could be invalid utf8, so it can fallback.
|
||||||
// We just increase the last letter to find the upper bound.
|
let mut docids = RoaringBitmap::new();
|
||||||
// The result could be invalid utf8, so it can fallback.
|
find_docids_of_facet_within_bounds(
|
||||||
let mut docids = RoaringBitmap::new();
|
rtxn,
|
||||||
find_docids_of_facet_within_bounds(
|
strings_db,
|
||||||
rtxn,
|
field_id,
|
||||||
strings_db,
|
&Included(&value),
|
||||||
field_id,
|
&Excluded(&value2),
|
||||||
&Included(&value),
|
universe,
|
||||||
&Excluded(&value2),
|
&mut docids,
|
||||||
universe,
|
)?;
|
||||||
&mut docids,
|
|
||||||
)?;
|
|
||||||
|
|
||||||
return Ok(docids);
|
return Ok(docids);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user