mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-15 13:58:36 +02:00
fix: Update the typos sort function to take the distance correctly
This commit is contained in:
parent
3f7697f9f0
commit
c99ba88288
1 changed files with 2 additions and 1 deletions
|
@ -7,9 +7,10 @@ use crate::rank::{match_query_index, Document};
|
||||||
fn sum_matches_typos(matches: &[Match]) -> u8 {
|
fn sum_matches_typos(matches: &[Match]) -> u8 {
|
||||||
// note that GroupBy will never return an empty group
|
// note that GroupBy will never return an empty group
|
||||||
// so we can do this assumption safely
|
// so we can do this assumption safely
|
||||||
|
// matches must and will never be empty
|
||||||
GroupBy::new(matches, match_query_index).map(|group| unsafe {
|
GroupBy::new(matches, match_query_index).map(|group| unsafe {
|
||||||
group.get_unchecked(0).distance
|
group.get_unchecked(0).distance
|
||||||
}).sum()
|
}).min().unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue