From 87e2bc3beda573a72c87647d614393d524bd5b44 Mon Sep 17 00:00:00 2001 From: Gregory Conrad Date: Mon, 28 Nov 2022 13:12:19 -0500 Subject: [PATCH] fix(reindex): reindex in a few more cases Cases: whenever searchable_fields OR user_defined_searchable_fields is modified --- milli/src/index.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/milli/src/index.rs b/milli/src/index.rs index 9e4e56de0..33c04789d 100644 --- a/milli/src/index.rs +++ b/milli/src/index.rs @@ -560,8 +560,9 @@ impl Index { } pub(crate) fn delete_all_searchable_fields(&self, wtxn: &mut RwTxn) -> heed::Result { - self.delete_searchable_fields(wtxn)?; - self.delete_user_defined_searchable_fields(wtxn) + let did_delete_searchable = self.delete_searchable_fields(wtxn)?; + let did_delete_user_defined = self.delete_user_defined_searchable_fields(wtxn)?; + Ok(did_delete_searchable || did_delete_user_defined) } /// Writes the searchable fields, when this list is specified, only these are indexed.