Update crates/milli/src/search/facet/filter.rs

This commit is contained in:
Tamo
2025-08-05 11:26:10 +02:00
committed by GitHub
parent afb367c7f4
commit 3d2c204f2d

View File

@ -433,8 +433,9 @@ impl<'a> Filter<'a> {
} }
}; };
if *last == 255 { if *last == u8::MAX {
// The prefix is invalid utf8, so no documents will match anyway // u8::MAX is a forbidden UTF-8 byte, we're guaranteed it cannot be sent through a filter to meilisearch, but just in case, we're going to return something
tracing::warn!("Found non utf-8 character in filter. That shouldn't be possible");
return Ok(RoaringBitmap::new()); return Ok(RoaringBitmap::new());
} }
*last += 1; *last += 1;