mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-26 03:55:07 +08: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 {
|
||||
// note that GroupBy will never return an empty group
|
||||
// so we can do this assumption safely
|
||||
// matches must and will never be empty
|
||||
GroupBy::new(matches, match_query_index).map(|group| unsafe {
|
||||
group.get_unchecked(0).distance
|
||||
}).sum()
|
||||
}).min().unwrap()
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
Loading…
Reference in New Issue
Block a user