From ca4876fd1026d5a3dfc96ffb479237144a26097e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Renault?= Date: Tue, 12 Mar 2024 16:18:58 +0100 Subject: [PATCH 1/2] Do not reindex when modifying unknown faceted field --- milli/src/update/settings.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/milli/src/update/settings.rs b/milli/src/update/settings.rs index 3cad79467..2f53718ac 100644 --- a/milli/src/update/settings.rs +++ b/milli/src/update/settings.rs @@ -1032,6 +1032,13 @@ impl<'a, 't, 'i> Settings<'a, 't, 'i> { { self.index.set_updated_at(self.wtxn, &OffsetDateTime::now_utc())?; + let existing_fields: HashSet<_> = self + .index + .field_distribution(self.wtxn)? + .into_iter() + .filter_map(|(field, count)| (count != 0).then_some(field)) + .collect(); + let old_faceted_fields = self.index.user_defined_faceted_fields(self.wtxn)?; let old_fields_ids_map = self.index.fields_ids_map(self.wtxn)?; @@ -1052,7 +1059,8 @@ impl<'a, 't, 'i> Settings<'a, 't, 'i> { // index new fields as facets. It means that the distinct attribute, // an Asc/Desc criterion or a filtered attribute as be added or removed. let new_faceted_fields = self.index.user_defined_faceted_fields(self.wtxn)?; - let faceted_updated = old_faceted_fields != new_faceted_fields; + let faceted_updated = + (&existing_fields - &old_faceted_fields) != (&existing_fields - &new_faceted_fields); let stop_words_updated = self.update_stop_words()?; let non_separator_tokens_updated = self.update_non_separator_tokens()?; From 7f3c495f5c42781e41fe23d6cce56ad1b7cac51e Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 13 Mar 2024 14:49:21 +0000 Subject: [PATCH 2/2] Update version for the next release (v1.7.1) in Cargo.toml --- Cargo.lock | 34 +++++++++++++++++----------------- Cargo.toml | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d6eb841ff..a1527c31c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -496,7 +496,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "benchmarks" -version = "1.7.0" +version = "1.7.1" dependencies = [ "anyhow", "bytes", @@ -630,7 +630,7 @@ dependencies = [ [[package]] name = "build-info" -version = "1.7.0" +version = "1.7.1" dependencies = [ "anyhow", "time", @@ -1531,7 +1531,7 @@ dependencies = [ [[package]] name = "dump" -version = "1.7.0" +version = "1.7.1" dependencies = [ "anyhow", "big_s", @@ -1769,7 +1769,7 @@ dependencies = [ [[package]] name = "file-store" -version = "1.7.0" +version = "1.7.1" dependencies = [ "faux", "tempfile", @@ -1792,7 +1792,7 @@ dependencies = [ [[package]] name = "filter-parser" -version = "1.7.0" +version = "1.7.1" dependencies = [ "insta", "nom", @@ -1812,7 +1812,7 @@ dependencies = [ [[package]] name = "flatten-serde-json" -version = "1.7.0" +version = "1.7.1" dependencies = [ "criterion", "serde_json", @@ -1930,7 +1930,7 @@ dependencies = [ [[package]] name = "fuzzers" -version = "1.7.0" +version = "1.7.1" dependencies = [ "arbitrary", "clap", @@ -2422,7 +2422,7 @@ checksum = "206ca75c9c03ba3d4ace2460e57b189f39f43de612c2f85836e65c929701bb2d" [[package]] name = "index-scheduler" -version = "1.7.0" +version = "1.7.1" dependencies = [ "anyhow", "big_s", @@ -2609,7 +2609,7 @@ dependencies = [ [[package]] name = "json-depth-checker" -version = "1.7.0" +version = "1.7.1" dependencies = [ "criterion", "serde_json", @@ -3117,7 +3117,7 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "meili-snap" -version = "1.7.0" +version = "1.7.1" dependencies = [ "insta", "md5", @@ -3126,7 +3126,7 @@ dependencies = [ [[package]] name = "meilisearch" -version = "1.7.0" +version = "1.7.1" dependencies = [ "actix-cors", "actix-http", @@ -3219,7 +3219,7 @@ dependencies = [ [[package]] name = "meilisearch-auth" -version = "1.7.0" +version = "1.7.1" dependencies = [ "base64 0.21.7", "enum-iterator", @@ -3238,7 +3238,7 @@ dependencies = [ [[package]] name = "meilisearch-types" -version = "1.7.0" +version = "1.7.1" dependencies = [ "actix-web", "anyhow", @@ -3268,7 +3268,7 @@ dependencies = [ [[package]] name = "meilitool" -version = "1.7.0" +version = "1.7.1" dependencies = [ "anyhow", "clap", @@ -3307,7 +3307,7 @@ dependencies = [ [[package]] name = "milli" -version = "1.7.0" +version = "1.7.1" dependencies = [ "arroy", "big_s", @@ -3748,7 +3748,7 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "permissive-json-pointer" -version = "1.7.0" +version = "1.7.1" dependencies = [ "big_s", "serde_json", @@ -5943,7 +5943,7 @@ dependencies = [ [[package]] name = "xtask" -version = "1.7.0" +version = "1.7.1" dependencies = [ "anyhow", "build-info", diff --git a/Cargo.toml b/Cargo.toml index 1d79fd196..5337ec5c3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ members = [ ] [workspace.package] -version = "1.7.0" +version = "1.7.1" authors = [ "Quentin de Quelen ", "Clément Renault ",