mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-07-29 09:39:58 +00:00
Fix the criteria to avoid always returning a placeholder
This commit is contained in:
@ -56,9 +56,13 @@ impl<'t> Criterion for Words<'t> {
|
||||
debug!("Words at iteration {} ({:?})", self.query_trees.len(), self.candidates);
|
||||
|
||||
match (self.query_trees.pop(), &mut self.candidates) {
|
||||
(_, Allowed(candidates)) if candidates.is_empty() => {
|
||||
(query_tree, Allowed(candidates)) if candidates.is_empty() => {
|
||||
self.query_trees = Vec::new();
|
||||
self.candidates = Candidates::default();
|
||||
return Ok(Some(CriterionResult {
|
||||
query_tree,
|
||||
candidates: take(&mut self.candidates).into_inner(),
|
||||
bucket_candidates: take(&mut self.bucket_candidates),
|
||||
}));
|
||||
},
|
||||
(Some(qt), Allowed(candidates)) => {
|
||||
let mut found_candidates = resolve_query_tree(self.ctx, &qt, &mut self.candidates_cache)?;
|
||||
|
Reference in New Issue
Block a user