Fix the tests

This commit is contained in:
Clément Renault
2023-11-15 10:21:30 +01:00
parent 4cfb48fbb6
commit 2495058a6e
2 changed files with 10 additions and 107 deletions

View File

@@ -147,6 +147,15 @@ pub fn expected_order(
new_groups
.extend(group.linear_group_by_key(|d| d.asc_desc_rank).map(Vec::from));
}
RankingRule::Boost(filter) => {
// move the matching documents first, then the ones that don't match
group.sort_by_key(|d| if execute_filter(filter, d).is_some() { 0 } else { 1 });
new_groups.extend(
group
.linear_group_by_key(|d| execute_filter(filter, d).is_some())
.map(Vec::from),
);
}
RankingRule::Asc(_) | RankingRule::Desc(_) | RankingRule::Sort => {
new_groups.push(group.clone())
}