mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-27 04:25:06 +08: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 super::{RankingRuleGraph, RankingRuleGraphTrait, DeadEndsCache};
|
||||
use super::{DeadEndsCache, RankingRuleGraph, RankingRuleGraphTrait};
|
||||
use crate::search::new::interner::{DedupInterner, Interned, MappedInterner};
|
||||
use crate::search::new::logger::SearchLogger;
|
||||
use crate::search::new::query_graph::QueryNodeData;
|
||||
@ -64,7 +64,7 @@ impl RankingRuleGraphTrait for TypoGraph {
|
||||
// Ngrams have a base typo cost
|
||||
// 2-gram -> equivalent to 1 typo
|
||||
// 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 {
|
||||
let term = term_interner.get(*value).clone();
|
||||
|
Loading…
Reference in New Issue
Block a user