Skip evaluating when a universe is empty, nothing can be found

This commit is contained in:
Clément Renault 2024-06-05 16:58:32 -04:00
parent a6f3a01c6a
commit 7967e93c16
No known key found for this signature in database
GPG Key ID: F250A4C4E3AE5F5F

View File

@ -343,6 +343,10 @@ impl<'a> Filter<'a> {
filterable_fields: &HashSet<String>,
universe: Option<&RoaringBitmap>,
) -> Result<RoaringBitmap> {
if universe.map_or(false, |u| u.is_empty()) {
return Ok(RoaringBitmap::new());
}
match &self.condition {
FilterCondition::Not(f) => {
// TODO improve the documents_ids to also support intersections at deserialize time.