From e078eafb1f1ead86672da7a868d5797cc6e01160 Mon Sep 17 00:00:00 2001 From: Quentin de Quelen Date: Sat, 18 Jan 2020 16:12:02 +0100 Subject: [PATCH] clean unused functions --- meilisearch-core/src/settings.rs | 2 +- meilisearch-core/src/store/main.rs | 29 ++--------------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/meilisearch-core/src/settings.rs b/meilisearch-core/src/settings.rs index 89601dc8b..8e7ab3dc6 100644 --- a/meilisearch-core/src/settings.rs +++ b/meilisearch-core/src/settings.rs @@ -122,7 +122,7 @@ impl ToString for RankingRule { RankingRule::Words => "_words".to_string(), RankingRule::Proximity => "_proximity".to_string(), RankingRule::Attribute => "_attribute".to_string(), - RankingRule::WordsPosition => "_word_position".to_string(), + RankingRule::WordsPosition => "_words_position".to_string(), RankingRule::Exact => "_exact".to_string(), RankingRule::Asc(field) => format!("asc({})", field), RankingRule::Dsc(field) => format!("dsc({})", field), diff --git a/meilisearch-core/src/store/main.rs b/meilisearch-core/src/store/main.rs index 96afc8263..131753d6b 100644 --- a/meilisearch-core/src/store/main.rs +++ b/meilisearch-core/src/store/main.rs @@ -1,5 +1,5 @@ use std::sync::Arc; -use std::collections::{HashMap, BTreeMap, BTreeSet}; +use std::collections::HashMap; use chrono::{DateTime, Utc}; use heed::types::{ByteSlice, OwnedType, SerdeBincode, Str}; @@ -134,8 +134,7 @@ impl Main { pub fn put_stop_words_fst(self, writer: &mut heed::RwTxn, fst: &fst::Set) -> ZResult<()> { let bytes = fst.as_fst().as_bytes(); - self.main - .put::<_, Str, ByteSlice>(writer, STOP_WORDS_KEY, bytes) + self.main.put::<_, Str, ByteSlice>(writer, STOP_WORDS_KEY, bytes) } pub fn stop_words_fst(self, reader: &heed::RoTxn) -> ZResult> { @@ -213,30 +212,6 @@ impl Main { self.main.delete::<_, Str>(writer, RANKING_DISTINCT_KEY) } - pub fn stop_words<'txn>(&self, reader: &'txn heed::RoTxn) -> ZResult>> { - self.main.get::<_, Str, SerdeBincode>>(reader, STOP_WORDS_KEY) - } - - pub fn put_stop_words(self, writer: &mut heed::RwTxn, value: BTreeSet) -> ZResult<()> { - self.main.put::<_, Str, SerdeBincode>>(writer, STOP_WORDS_KEY, &value) - } - - pub fn delete_stop_words(self, writer: &mut heed::RwTxn) -> ZResult { - self.main.delete::<_, Str>(writer, STOP_WORDS_KEY) - } - - pub fn synonyms<'txn>(&self, reader: &'txn heed::RoTxn) -> ZResult>>> { - self.main.get::<_, Str, SerdeBincode>>>(reader, SYNONYMS_KEY) - } - - pub fn put_synonyms(self, writer: &mut heed::RwTxn, value: BTreeMap>) -> ZResult<()> { - self.main.put::<_, Str, SerdeBincode>>>(writer, SYNONYMS_KEY, &value) - } - - pub fn delete_synonyms(self, writer: &mut heed::RwTxn) -> ZResult { - self.main.delete::<_, Str>(writer, SYNONYMS_KEY) - } - pub fn put_customs(self, writer: &mut heed::RwTxn, customs: &[u8]) -> ZResult<()> { self.main .put::<_, Str, ByteSlice>(writer, CUSTOMS_KEY, customs)