mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 00:34:26 +01:00
fix: Update the typos sort function to take the distance correctly
This commit is contained in:
parent
3f7697f9f0
commit
c99ba88288
@ -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…
Reference in New Issue
Block a user