mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08:00
Remove optimization where ranking rules are not executed on buckets of a single document
This commit is contained in:
parent
b8f4e2b3e4
commit
0cfecf4e9a
@ -104,23 +104,23 @@ pub fn bucket_sort<'ctx, Q: RankingRuleQueryTrait>(
|
|||||||
length,
|
length,
|
||||||
logger,
|
logger,
|
||||||
&mut valid_docids,
|
&mut valid_docids,
|
||||||
|
&mut valid_scores,
|
||||||
&mut all_candidates,
|
&mut all_candidates,
|
||||||
&mut ranking_rule_universes,
|
&mut ranking_rule_universes,
|
||||||
&mut ranking_rules,
|
&mut ranking_rules,
|
||||||
cur_ranking_rule_index,
|
cur_ranking_rule_index,
|
||||||
&mut cur_offset,
|
&mut cur_offset,
|
||||||
distinct_fid,
|
distinct_fid,
|
||||||
|
&ranking_rule_scores,
|
||||||
$candidates,
|
$candidates,
|
||||||
)?;
|
)?;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
while valid_docids.len() < length {
|
while valid_docids.len() < length {
|
||||||
// The universe for this bucket is zero or one element, so we don't need to sort
|
// The universe for this bucket is zero, so we don't need to sort
|
||||||
// anything, just extend the results and go back to the parent ranking rule.
|
// anything, just go back to the parent ranking rule.
|
||||||
if ranking_rule_universes[cur_ranking_rule_index].len() <= 1 {
|
if ranking_rule_universes[cur_ranking_rule_index].is_empty() {
|
||||||
let bucket = std::mem::take(&mut ranking_rule_universes[cur_ranking_rule_index]);
|
|
||||||
maybe_add_to_results!(bucket);
|
|
||||||
back!();
|
back!();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -143,7 +143,6 @@ pub fn bucket_sort<'ctx, Q: RankingRuleQueryTrait>(
|
|||||||
ranking_rule_universes[cur_ranking_rule_index] -= &next_bucket.candidates;
|
ranking_rule_universes[cur_ranking_rule_index] -= &next_bucket.candidates;
|
||||||
|
|
||||||
if cur_ranking_rule_index == ranking_rules_len - 1
|
if cur_ranking_rule_index == ranking_rules_len - 1
|
||||||
|| next_bucket.candidates.len() <= 1
|
|
||||||
|| cur_offset + (next_bucket.candidates.len() as usize) < from
|
|| cur_offset + (next_bucket.candidates.len() as usize) < from
|
||||||
{
|
{
|
||||||
maybe_add_to_results!(next_bucket.candidates);
|
maybe_add_to_results!(next_bucket.candidates);
|
||||||
|
Loading…
Reference in New Issue
Block a user