From f5306eb5b0a66520fd59aa5a75cc5b86aa1108a4 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Mon, 6 Jun 2022 15:54:50 +0200 Subject: [PATCH] Set disabled_words to default when Index::exact_words returns None --- meilisearch-lib/src/index/index.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/meilisearch-lib/src/index/index.rs b/meilisearch-lib/src/index/index.rs index 9c6150cfb..1fe191c41 100644 --- a/meilisearch-lib/src/index/index.rs +++ b/meilisearch-lib/src/index/index.rs @@ -175,12 +175,10 @@ impl Index { two_typos: Setting::Set(self.min_word_len_two_typos(txn)?), }; - let disabled_words = self - .exact_words(txn)? - .into_stream() - .into_strs()? - .into_iter() - .collect(); + let disabled_words = match self.exact_words(txn)? { + Some(fst) => fst.into_stream().into_strs()?.into_iter().collect(), + None => BTreeSet::new(), + }; let disabled_attributes = self .exact_attributes(txn)?