From 88b3c051551ad49e3c0ac94ea89dcc27d1d02fb8 Mon Sep 17 00:00:00 2001 From: Quentin de Quelen Date: Thu, 12 Dec 2019 15:31:39 +0100 Subject: [PATCH] Stop words; Do not reindex all documents if there is no documents --- .../src/update/stop_words_deletion.rs | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/meilisearch-core/src/update/stop_words_deletion.rs b/meilisearch-core/src/update/stop_words_deletion.rs index 2ef438454..9c799b402 100644 --- a/meilisearch-core/src/update/stop_words_deletion.rs +++ b/meilisearch-core/src/update/stop_words_deletion.rs @@ -101,14 +101,18 @@ pub fn apply_stop_words_deletion( // now that we have setup the stop words // lets reindex everything... - reindex_all_documents( - writer, - main_store, - documents_fields_store, - documents_fields_counts_store, - postings_lists_store, - docs_words_store, - )?; + if let Ok(number) = main_store.number_of_documents(writer) { + if number > 0 { + reindex_all_documents( + writer, + main_store, + documents_fields_store, + documents_fields_counts_store, + postings_lists_store, + docs_words_store, + )?; + } + } Ok(()) }