web search done right
Enable spell dictionary by default but reduce worst case compute
Mikkel Denker5c0487ad8938
diff --git a/core/src/config/defaults.rs b/core/src/config/defaults.rsindex ba4a376c..8ec85ca0 100644--- a/core/src/config/defaults.rs+++ b/core/src/config/defaults.rs@@ -110,6 +110,6 @@ pub struct SearchServer;impl SearchServer {pub fn build_spell_dictionary() -> bool {- false+ true}}diff --git a/core/src/spell/mod.rs b/core/src/spell/mod.rsindex b6091e45..7dfaaf8a 100644--- a/core/src/spell/mod.rs+++ b/core/src/spell/mod.rs@@ -107,7 +107,7 @@ pub struct Spell {impl Spell {pub fn for_index(index: &Index) -> Self {let dict = Self::build_dict(index);- let spell_checker = SpellChecker::new(dict.clone(), LogarithmicEdit::new(4));+ let spell_checker = SpellChecker::new(dict.clone(), LogarithmicEdit::new(3));Self {dict,@@ -118,7 +118,7 @@ impl Spell {info!("Building spell correction dictionary");let searcher = index.inverted_index.tv_searcher();let schema = searcher.schema();- let mut dict = DictionaryBuilder::new(10_000);+ let mut dict = DictionaryBuilder::new(20_000);#[allow(unused_assignments, unused_mut)]let mut limit_terms: Option<usize> = None;