diff --git a/src/rank/criterion/sum_of_words_attribute.rs b/src/rank/criterion/sum_of_words_attribute.rs index cfcaaec68..aea21c35f 100644 --- a/src/rank/criterion/sum_of_words_attribute.rs +++ b/src/rank/criterion/sum_of_words_attribute.rs @@ -8,11 +8,11 @@ use crate::database::DatabaseView; use crate::rank::criterion::Criterion; #[inline] -fn sum_matches_attributes(matches: &Matches) -> u16 { +fn sum_matches_attributes(matches: &Matches) -> usize { // note that GroupBy will never return an empty group // so we can do this assumption safely matches.query_index_groups().map(|group| { - unsafe { group.get_unchecked(0).attribute.attribute() } + unsafe { group.get_unchecked(0).attribute.attribute() as usize } }).sum() } diff --git a/src/rank/criterion/sum_of_words_position.rs b/src/rank/criterion/sum_of_words_position.rs index e1d650534..0b27184ba 100644 --- a/src/rank/criterion/sum_of_words_position.rs +++ b/src/rank/criterion/sum_of_words_position.rs @@ -8,11 +8,11 @@ use crate::rank::criterion::Criterion; use crate::database::DatabaseView; #[inline] -fn sum_matches_attribute_index(matches: &Matches) -> u32 { +fn sum_matches_attribute_index(matches: &Matches) -> usize { // note that GroupBy will never return an empty group // so we can do this assumption safely matches.query_index_groups().map(|group| { - unsafe { group.get_unchecked(0).attribute.word_index() } + unsafe { group.get_unchecked(0).attribute.word_index() as usize } }).sum() }