mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-01-11 14:04:31 +01:00
Fix bug in cost of typo conditions
This commit is contained in:
parent
1e6e624078
commit
49240c367a
@ -1,6 +1,6 @@
|
|||||||
use roaring::RoaringBitmap;
|
use roaring::RoaringBitmap;
|
||||||
|
|
||||||
use super::{RankingRuleGraph, RankingRuleGraphTrait, DeadEndsCache};
|
use super::{DeadEndsCache, RankingRuleGraph, RankingRuleGraphTrait};
|
||||||
use crate::search::new::interner::{DedupInterner, Interned, MappedInterner};
|
use crate::search::new::interner::{DedupInterner, Interned, MappedInterner};
|
||||||
use crate::search::new::logger::SearchLogger;
|
use crate::search::new::logger::SearchLogger;
|
||||||
use crate::search::new::query_graph::QueryNodeData;
|
use crate::search::new::query_graph::QueryNodeData;
|
||||||
@ -64,7 +64,7 @@ impl RankingRuleGraphTrait for TypoGraph {
|
|||||||
// Ngrams have a base typo cost
|
// Ngrams have a base typo cost
|
||||||
// 2-gram -> equivalent to 1 typo
|
// 2-gram -> equivalent to 1 typo
|
||||||
// 3-gram -> equivalent to 2 typos
|
// 3-gram -> equivalent to 2 typos
|
||||||
let base_cost = positions.len().max(2) as u8;
|
let base_cost = positions.len().min(2) as u8;
|
||||||
|
|
||||||
for nbr_typos in 0..=2 {
|
for nbr_typos in 0..=2 {
|
||||||
let term = term_interner.get(*value).clone();
|
let term = term_interner.get(*value).clone();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user