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

@ -35,14 +35,14 @@ futures-util = "0.3.8"
grenad = { git = "https://github.com/Kerollmops/grenad.git", rev = "3adcb26" }
heed = "0.10.6"
http = "0.2.1"
indexmap = { version = "1.3.2", features = ["serde-1"] }
indexmap = { version = "1.3.2", features = ["serde-1"] }
itertools = "0.10.0"
log = "0.4.8"
main_error = "0.1.0"
meilisearch-error = { path = "../meilisearch-error" }
meilisearch-tokenizer = { git = "https://github.com/meilisearch/Tokenizer.git", branch = "main" }
meilisearch-tokenizer = { git = "https://github.com/meilisearch/Tokenizer.git", tag = "v0.2.0" }
memmap = "0.7.0"
milli = { git = "https://github.com/meilisearch/milli.git", rev = "2bcdd8844c4ec9f6f8a34617ea0e4321fa633c0c" }
milli = { git = "https://github.com/meilisearch/milli.git", tag = "v0.1.0" }
mime = "0.3.16"
once_cell = "1.5.2"
parking_lot = "0.11.1"
@ -66,14 +66,14 @@ oxidized-json-checker = "0.3.2"
[dependencies.sentry]
default-features = false
features = [
"with_client_implementation",
"with_panic",
"with_failure",
"with_device_info",
"with_rust_info",
"with_reqwest_transport",
"with_rustls",
"with_env_logger"
"with_client_implementation",
"with_panic",
"with_failure",
"with_device_info",
"with_rust_info",
"with_reqwest_transport",
"with_rustls",
"with_env_logger"
]
optional = true
version = "0.18.1"

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 }
}