mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 12:05:05 +08:00
MultiOps trait for OR operations
This commit is contained in:
parent
cb765ad249
commit
531e3d7d6a
@ -4,7 +4,7 @@ use std::ops::Bound::{self, Excluded, Included};
|
|||||||
|
|
||||||
use either::Either;
|
use either::Either;
|
||||||
pub use filter_parser::{Condition, Error as FPError, FilterCondition, Token};
|
pub use filter_parser::{Condition, Error as FPError, FilterCondition, Token};
|
||||||
use roaring::RoaringBitmap;
|
use roaring::{MultiOps, RoaringBitmap};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
|
|
||||||
use super::facet_range_search;
|
use super::facet_range_search;
|
||||||
@ -382,14 +382,10 @@ impl<'a> Filter<'a> {
|
|||||||
}))?
|
}))?
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FilterCondition::Or(subfilters) => {
|
FilterCondition::Or(subfilters) => subfilters
|
||||||
let mut bitmap = RoaringBitmap::new();
|
.iter()
|
||||||
for f in subfilters {
|
.map(|f| Self::inner_evaluate(&(f.clone()).into(), rtxn, index, filterable_fields))
|
||||||
bitmap |=
|
.union(),
|
||||||
Self::inner_evaluate(&(f.clone()).into(), rtxn, index, filterable_fields)?;
|
|
||||||
}
|
|
||||||
Ok(bitmap)
|
|
||||||
}
|
|
||||||
FilterCondition::And(subfilters) => {
|
FilterCondition::And(subfilters) => {
|
||||||
let mut subfilters_iter = subfilters.iter();
|
let mut subfilters_iter = subfilters.iter();
|
||||||
if let Some(first_subfilter) = subfilters_iter.next() {
|
if let Some(first_subfilter) = subfilters_iter.next() {
|
||||||
|
Loading…
Reference in New Issue
Block a user