mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-31 10:50:03 +00:00
Remove excluded document in criteria iterations
- pass excluded document to criteria to remove them in higher levels of the bucket-sort - merge already returned document with excluded documents to avoid duplicas Related to #125 and #112 Fix #170
This commit is contained in:
@ -25,7 +25,7 @@ mod words;
|
||||
pub mod r#final;
|
||||
|
||||
pub trait Criterion {
|
||||
fn next(&mut self, wdcache: &mut WordDerivationsCache) -> anyhow::Result<Option<CriterionResult>>;
|
||||
fn next(&mut self, params: &mut CriterionParameters) -> anyhow::Result<Option<CriterionResult>>;
|
||||
}
|
||||
|
||||
/// The result of a call to the parent criterion.
|
||||
@ -40,6 +40,12 @@ pub struct CriterionResult {
|
||||
bucket_candidates: RoaringBitmap,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
pub struct CriterionParameters<'a> {
|
||||
wdcache: &'a mut WordDerivationsCache,
|
||||
excluded_candidates: &'a RoaringBitmap,
|
||||
}
|
||||
|
||||
/// Either a set of candidates that defines the candidates
|
||||
/// that are allowed to be returned,
|
||||
/// or the candidates that must never be returned.
|
||||
|
Reference in New Issue
Block a user