fix(http, index): init analyzer with optional stop words

Next release

update tokenizer
This commit is contained in:
Alexey Shekhirin 2021-04-01 17:49:11 +03:00
parent f881e8691e
commit 51ba1bd7d3
No known key found for this signature in database
GPG key ID: AF9A26AA133B5B98
3 changed files with 21 additions and 34 deletions

View file

@ -155,7 +155,10 @@ pub struct Highlighter<'a, A> {
impl<'a, A: AsRef<[u8]>> Highlighter<'a, A> {
pub fn new(stop_words: &'a fst::Set<A>) -> Self {
let analyzer = Analyzer::new(AnalyzerConfig::default_with_stopwords(stop_words));
let mut config = AnalyzerConfig::default();
config.stop_words(stop_words);
let analyzer = Analyzer::new(config);
Self { analyzer }
}