From 6f534540a641cbb855af52ec6f7c60f24827d934 Mon Sep 17 00:00:00 2001 From: Quentin de Quelen Date: Sat, 18 Jan 2020 16:11:40 +0100 Subject: [PATCH] fix error on stop words fst --- meilisearch-core/src/update/settings_update.rs | 3 --- meilisearch-http/Cargo.toml | 2 +- meilisearch-http/src/error.rs | 7 +++---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/meilisearch-core/src/update/settings_update.rs b/meilisearch-core/src/update/settings_update.rs index da9d23047..499bdca35 100644 --- a/meilisearch-core/src/update/settings_update.rs +++ b/meilisearch-core/src/update/settings_update.rs @@ -197,8 +197,6 @@ pub fn apply_stop_words_update( )?; } - main_store.put_stop_words(writer, stop_words)?; - Ok(must_reindex) } @@ -341,7 +339,6 @@ pub fn apply_synonyms_update( .unwrap(); main_store.put_synonyms_fst(writer, &synonyms_set)?; - main_store.put_synonyms(writer, synonyms)?; Ok(()) } diff --git a/meilisearch-http/Cargo.toml b/meilisearch-http/Cargo.toml index 61c34b5e7..64dd2ba17 100644 --- a/meilisearch-http/Cargo.toml +++ b/meilisearch-http/Cargo.toml @@ -19,7 +19,6 @@ bincode = "1.2.0" chrono = { version = "0.4.9", features = ["serde"] } crossbeam-channel = "0.4.0" env_logger = "0.7.1" -fst = { version = "0.3.5", default-features = false } heed = "0.6.1" http = "0.1.19" indexmap = { version = "1.3.0", features = ["serde-1"] } @@ -46,6 +45,7 @@ whoami = "0.6" http-service-mock = "0.4.0" http-service = "0.4.0" tempdir = "0.3.7" +assert-json-diff = "1.0.1" [build-dependencies] vergen = "3.0.4" diff --git a/meilisearch-http/src/error.rs b/meilisearch-http/src/error.rs index 220519231..23f2765f9 100644 --- a/meilisearch-http/src/error.rs +++ b/meilisearch-http/src/error.rs @@ -137,8 +137,8 @@ impl From for ResponseError { } } -impl From for ResponseError { - fn from(err: fst::Error) -> ResponseError { +impl From for ResponseError { + fn from(err: meilisearch_core::FstError) -> ResponseError { ResponseError::internal(err) } } @@ -149,7 +149,6 @@ impl From for ResponseError { } } - pub trait IntoInternalError { fn into_internal_error(self) -> SResult; } @@ -159,7 +158,7 @@ impl IntoInternalError for Option { fn into_internal_error(self) -> SResult { match self { Some(value) => Ok(value), - None => Err(ResponseError::internal("Heed ")) + None => Err(ResponseError::internal("Heed cannot find requested value")) } } }