mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-30 00:55:00 +08:00
fix: Filter and count the exact matching words
This commit is contained in:
parent
c594597a01
commit
0d07af3caf
@ -9,13 +9,13 @@ use crate::database::DatabaseView;
|
|||||||
use crate::Match;
|
use crate::Match;
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn contains_exact(matches: &[Match]) -> bool {
|
fn contains_exact(matches: &&[Match]) -> bool {
|
||||||
matches.iter().any(|m| m.is_exact)
|
matches.iter().any(|m| m.is_exact)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
fn number_exact_matches(matches: &Matches) -> usize {
|
fn number_exact_matches(matches: &Matches) -> usize {
|
||||||
matches.query_index_groups().map(contains_exact).count()
|
matches.query_index_groups().filter(contains_exact).count()
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
|
Loading…
Reference in New Issue
Block a user