From 0f78703b85f0c11a2f8761aa093875b8a143b004 Mon Sep 17 00:00:00 2001 From: Tamo Date: Mon, 20 May 2024 10:58:08 +0200 Subject: [PATCH 1/6] add a test reproducing the bug --- meilisearch/tests/search/geo.rs | 58 +++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/meilisearch/tests/search/geo.rs b/meilisearch/tests/search/geo.rs index 5c6bb78a1..0169734c8 100644 --- a/meilisearch/tests/search/geo.rs +++ b/meilisearch/tests/search/geo.rs @@ -117,3 +117,61 @@ async fn geo_bounding_box_with_string_and_number() { ) .await; } + +#[actix_rt::test] +async fn bug_4640() { + // https://github.com/meilisearch/meilisearch/issues/4640 + let server = Server::new().await; + let index = server.index("test"); + + let documents = DOCUMENTS.clone(); + index.add_documents(documents, None).await; + index.update_settings_filterable_attributes(json!(["_geo"])).await; + let (ret, _code) = index.update_settings_sortable_attributes(json!(["_geo"])).await; + index.wait_task(ret.uid()).await; + + // Sort the document with the second one first + index + .search( + json!({ + "sort": ["_geoPoint(45.4777599, 9.1967508):asc"], + }), + |response, code| { + assert_eq!(code, 200, "{}", response); + snapshot!(json_string!(response, { ".processingTimeMs" => "[time]" }), @r###" + { + "hits": [ + { + "id": 1, + "name": "Taco Truck", + "address": "444 Salsa Street, Burritoville", + "type": "Mexican", + "rating": 9, + "_geo": { + "lat": 34.0522, + "lng": -118.2437 + } + }, + { + "id": 2, + "name": "La Bella Italia", + "address": "456 Elm Street, Townsville", + "type": "Italian", + "rating": 9, + "_geo": { + "lat": "45.4777599", + "lng": "9.1967508" + } + } + ], + "query": "", + "processingTimeMs": "[time]", + "limit": 20, + "offset": 0, + "estimatedTotalHits": 2 + } + "###); + }, + ) + .await; +} From fc7e8172219e0ee4c36845772099f5de33869a44 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Mon, 20 May 2024 12:27:26 +0200 Subject: [PATCH 2/6] Index geo points based on the settings differences --- .../extract/extract_geo_points.rs | 102 +++++++++--------- .../src/update/index_documents/extract/mod.rs | 7 +- milli/src/update/index_documents/mod.rs | 20 ---- milli/src/update/settings.rs | 25 +++++ 4 files changed, 79 insertions(+), 75 deletions(-) diff --git a/milli/src/update/index_documents/extract/extract_geo_points.rs b/milli/src/update/index_documents/extract/extract_geo_points.rs index cfcc021c6..01d53be1a 100644 --- a/milli/src/update/index_documents/extract/extract_geo_points.rs +++ b/milli/src/update/index_documents/extract/extract_geo_points.rs @@ -8,6 +8,7 @@ use super::helpers::{create_writer, writer_into_reader, GrenadParameters}; use crate::error::GeoError; use crate::update::del_add::{DelAdd, KvReaderDelAdd, KvWriterDelAdd}; use crate::update::index_documents::extract_finite_float_from_value; +use crate::update::settings::{InnerIndexSettings, InnerIndexSettingsDiff}; use crate::{FieldId, InternalError, Result}; /// Extracts the geographical coordinates contained in each document under the `_geo` field. @@ -18,7 +19,7 @@ pub fn extract_geo_points( obkv_documents: grenad::Reader, indexer: GrenadParameters, primary_key_id: FieldId, - (lat_fid, lng_fid): (FieldId, FieldId), + settings_diff: &InnerIndexSettingsDiff, ) -> Result>> { puffin::profile_function!(); @@ -40,47 +41,27 @@ pub fn extract_geo_points( serde_json::from_slice(document_id).unwrap() }; - // first we get the two fields - match (obkv.get(lat_fid), obkv.get(lng_fid)) { - (Some(lat), Some(lng)) => { - let deladd_lat_obkv = KvReaderDelAdd::new(lat); - let deladd_lng_obkv = KvReaderDelAdd::new(lng); + // extract old version + let del_lat_lng = + extract_lat_lng(&obkv, &settings_diff.old, DelAdd::Deletion, &document_id)?; + // extract new version + let add_lat_lng = + extract_lat_lng(&obkv, &settings_diff.new, DelAdd::Addition, &document_id)?; - // then we extract the values - let del_lat_lng = deladd_lat_obkv - .get(DelAdd::Deletion) - .zip(deladd_lng_obkv.get(DelAdd::Deletion)) - .map(|(lat, lng)| extract_lat_lng(lat, lng, document_id)) - .transpose()?; - let add_lat_lng = deladd_lat_obkv - .get(DelAdd::Addition) - .zip(deladd_lng_obkv.get(DelAdd::Addition)) - .map(|(lat, lng)| extract_lat_lng(lat, lng, document_id)) - .transpose()?; - - if del_lat_lng != add_lat_lng { - let mut obkv = KvWriterDelAdd::memory(); - if let Some([lat, lng]) = del_lat_lng { - #[allow(clippy::drop_non_drop)] - let bytes: [u8; 16] = concat_arrays![lat.to_ne_bytes(), lng.to_ne_bytes()]; - obkv.insert(DelAdd::Deletion, bytes)?; - } - if let Some([lat, lng]) = add_lat_lng { - #[allow(clippy::drop_non_drop)] - let bytes: [u8; 16] = concat_arrays![lat.to_ne_bytes(), lng.to_ne_bytes()]; - obkv.insert(DelAdd::Addition, bytes)?; - } - let bytes = obkv.into_inner()?; - writer.insert(docid_bytes, bytes)?; - } + if del_lat_lng != add_lat_lng { + let mut obkv = KvWriterDelAdd::memory(); + if let Some([lat, lng]) = del_lat_lng { + #[allow(clippy::drop_non_drop)] + let bytes: [u8; 16] = concat_arrays![lat.to_ne_bytes(), lng.to_ne_bytes()]; + obkv.insert(DelAdd::Deletion, bytes)?; } - (None, Some(_)) => { - return Err(GeoError::MissingLatitude { document_id: document_id() }.into()) + if let Some([lat, lng]) = add_lat_lng { + #[allow(clippy::drop_non_drop)] + let bytes: [u8; 16] = concat_arrays![lat.to_ne_bytes(), lng.to_ne_bytes()]; + obkv.insert(DelAdd::Addition, bytes)?; } - (Some(_), None) => { - return Err(GeoError::MissingLongitude { document_id: document_id() }.into()) - } - (None, None) => (), + let bytes = obkv.into_inner()?; + writer.insert(docid_bytes, bytes)?; } } @@ -88,16 +69,37 @@ pub fn extract_geo_points( } /// Extract the finite floats lat and lng from two bytes slices. -fn extract_lat_lng(lat: &[u8], lng: &[u8], document_id: impl Fn() -> Value) -> Result<[f64; 2]> { - let lat = extract_finite_float_from_value( - serde_json::from_slice(lat).map_err(InternalError::SerdeJson)?, - ) - .map_err(|lat| GeoError::BadLatitude { document_id: document_id(), value: lat })?; +fn extract_lat_lng( + document: &obkv::KvReader, + settings: &InnerIndexSettings, + deladd: DelAdd, + document_id: impl Fn() -> Value, +) -> Result> { + match settings.geo_fields_ids { + Some((lat_fid, lng_fid)) => { + let lat = document.get(lat_fid).map(KvReaderDelAdd::new).and_then(|r| r.get(deladd)); + let lng = document.get(lng_fid).map(KvReaderDelAdd::new).and_then(|r| r.get(deladd)); + let (lat, lng) = match (lat, lng) { + (Some(lat), Some(lng)) => (lat, lng), + (Some(lat), None) => { + return Err(GeoError::MissingLatitude { document_id: document_id() }.into()) + } + (None, Some(lng)) => { + return Err(GeoError::MissingLongitude { document_id: document_id() }.into()) + } + (None, None) => return Ok(None), + }; + let lat = extract_finite_float_from_value( + serde_json::from_slice(lat).map_err(InternalError::SerdeJson)?, + ) + .map_err(|lat| GeoError::BadLatitude { document_id: document_id(), value: lat })?; - let lng = extract_finite_float_from_value( - serde_json::from_slice(lng).map_err(InternalError::SerdeJson)?, - ) - .map_err(|lng| GeoError::BadLongitude { document_id: document_id(), value: lng })?; - - Ok([lat, lng]) + let lng = extract_finite_float_from_value( + serde_json::from_slice(lng).map_err(InternalError::SerdeJson)?, + ) + .map_err(|lng| GeoError::BadLongitude { document_id: document_id(), value: lng })?; + Ok(Some([lat, lng])) + } + None => Ok(None), + } } diff --git a/milli/src/update/index_documents/extract/mod.rs b/milli/src/update/index_documents/extract/mod.rs index 573e0898a..35a4c4344 100644 --- a/milli/src/update/index_documents/extract/mod.rs +++ b/milli/src/update/index_documents/extract/mod.rs @@ -43,7 +43,6 @@ pub(crate) fn data_from_obkv_documents( indexer: GrenadParameters, lmdb_writer_sx: Sender>, primary_key_id: FieldId, - geo_fields_ids: Option<(FieldId, FieldId)>, settings_diff: Arc, max_positions_per_attributes: Option, ) -> Result<()> { @@ -72,7 +71,6 @@ pub(crate) fn data_from_obkv_documents( indexer, lmdb_writer_sx.clone(), primary_key_id, - geo_fields_ids, settings_diff.clone(), max_positions_per_attributes, ) @@ -300,7 +298,6 @@ fn send_and_extract_flattened_documents_data( indexer: GrenadParameters, lmdb_writer_sx: Sender>, primary_key_id: FieldId, - geo_fields_ids: Option<(FieldId, FieldId)>, settings_diff: Arc, max_positions_per_attributes: Option, ) -> Result<( @@ -310,12 +307,12 @@ fn send_and_extract_flattened_documents_data( let flattened_documents_chunk = flattened_documents_chunk.and_then(|c| unsafe { as_cloneable_grenad(&c) })?; - if let Some(geo_fields_ids) = geo_fields_ids { + if settings_diff.run_geo_indexing() { let documents_chunk_cloned = flattened_documents_chunk.clone(); let lmdb_writer_sx_cloned = lmdb_writer_sx.clone(); rayon::spawn(move || { let result = - extract_geo_points(documents_chunk_cloned, indexer, primary_key_id, geo_fields_ids); + extract_geo_points(documents_chunk_cloned, indexer, primary_key_id, &settings_diff); let _ = match result { Ok(geo_points) => lmdb_writer_sx_cloned.send(Ok(TypedChunk::GeoPoints(geo_points))), Err(error) => lmdb_writer_sx_cloned.send(Err(error)), diff --git a/milli/src/update/index_documents/mod.rs b/milli/src/update/index_documents/mod.rs index bb180a7ee..b4ab63def 100644 --- a/milli/src/update/index_documents/mod.rs +++ b/milli/src/update/index_documents/mod.rs @@ -327,25 +327,6 @@ where // get the fid of the `_geo.lat` and `_geo.lng` fields. let mut field_id_map = self.index.fields_ids_map(self.wtxn)?; - // self.index.fields_ids_map($a)? ==>> field_id_map - let geo_fields_ids = match field_id_map.id("_geo") { - Some(gfid) => { - let is_sortable = self.index.sortable_fields_ids(self.wtxn)?.contains(&gfid); - let is_filterable = self.index.filterable_fields_ids(self.wtxn)?.contains(&gfid); - // if `_geo` is faceted then we get the `lat` and `lng` - if is_sortable || is_filterable { - let field_ids = field_id_map - .insert("_geo.lat") - .zip(field_id_map.insert("_geo.lng")) - .ok_or(UserError::AttributeLimitReached)?; - Some(field_ids) - } else { - None - } - } - None => None, - }; - let pool_params = GrenadParameters { chunk_compression_type: self.indexer_config.chunk_compression_type, chunk_compression_level: self.indexer_config.chunk_compression_level, @@ -412,7 +393,6 @@ where pool_params, lmdb_writer_sx.clone(), primary_key_id, - geo_fields_ids, settings_diff.clone(), max_positions_per_attributes, ) diff --git a/milli/src/update/settings.rs b/milli/src/update/settings.rs index 1997e966e..5c53e1324 100644 --- a/milli/src/update/settings.rs +++ b/milli/src/update/settings.rs @@ -1161,6 +1161,11 @@ impl InnerIndexSettingsDiff { pub fn settings_update_only(&self) -> bool { self.settings_update_only } + + pub fn run_geo_indexing(&self) -> bool { + self.old.geo_fields_ids != self.new.geo_fields_ids + || (!self.settings_update_only && self.new.geo_fields_ids.is_some()) + } } #[derive(Clone)] @@ -1177,6 +1182,7 @@ pub(crate) struct InnerIndexSettings { pub proximity_precision: ProximityPrecision, pub embedding_configs: EmbeddingConfigs, pub existing_fields: HashSet, + pub geo_fields_ids: Option<(FieldId, FieldId)>, } impl InnerIndexSettings { @@ -1200,6 +1206,24 @@ impl InnerIndexSettings { .into_iter() .filter_map(|(field, count)| (count != 0).then_some(field)) .collect(); + // index.fields_ids_map($a)? ==>> fields_ids_map + let geo_fields_ids = match fields_ids_map.id("_geo") { + Some(gfid) => { + let is_sortable = index.sortable_fields_ids(rtxn)?.contains(&gfid); + let is_filterable = index.filterable_fields_ids(rtxn)?.contains(&gfid); + // if `_geo` is faceted then we get the `lat` and `lng` + if is_sortable || is_filterable { + let field_ids = fields_ids_map + .insert("_geo.lat") + .zip(fields_ids_map.insert("_geo.lng")) + .ok_or(UserError::AttributeLimitReached)?; + Some(field_ids) + } else { + None + } + } + None => None, + }; Ok(Self { stop_words, @@ -1214,6 +1238,7 @@ impl InnerIndexSettings { proximity_precision, embedding_configs, existing_fields, + geo_fields_ids, }) } From 3e94a907229c9a22bbad9bd470601c34ac1e119b Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Tue, 21 May 2024 13:39:46 +0200 Subject: [PATCH 3/6] Fixes --- meilisearch/tests/search/geo.rs | 32 ++++++++++++------- .../extract/extract_fid_docid_facet_values.rs | 15 ++++++--- .../extract/extract_geo_points.rs | 4 +-- .../src/update/index_documents/extract/mod.rs | 2 +- milli/src/update/index_documents/mod.rs | 3 -- milli/src/update/settings.rs | 2 +- 6 files changed, 34 insertions(+), 24 deletions(-) diff --git a/meilisearch/tests/search/geo.rs b/meilisearch/tests/search/geo.rs index 0169734c8..8754453ba 100644 --- a/meilisearch/tests/search/geo.rs +++ b/meilisearch/tests/search/geo.rs @@ -141,17 +141,6 @@ async fn bug_4640() { snapshot!(json_string!(response, { ".processingTimeMs" => "[time]" }), @r###" { "hits": [ - { - "id": 1, - "name": "Taco Truck", - "address": "444 Salsa Street, Burritoville", - "type": "Mexican", - "rating": 9, - "_geo": { - "lat": 34.0522, - "lng": -118.2437 - } - }, { "id": 2, "name": "La Bella Italia", @@ -162,13 +151,32 @@ async fn bug_4640() { "lat": "45.4777599", "lng": "9.1967508" } + }, + { + "id": 1, + "name": "Taco Truck", + "address": "444 Salsa Street, Burritoville", + "type": "Mexican", + "rating": 9, + "_geo": { + "lat": 34.0522, + "lng": -118.2437 + }, + "_geoDistance": 9714063 + }, + { + "id": 3, + "name": "Crêpe Truck", + "address": "2 Billig Avenue, Rouenville", + "type": "French", + "rating": 10 } ], "query": "", "processingTimeMs": "[time]", "limit": 20, "offset": 0, - "estimatedTotalHits": 2 + "estimatedTotalHits": 3 } "###); }, diff --git a/milli/src/update/index_documents/extract/extract_fid_docid_facet_values.rs b/milli/src/update/index_documents/extract/extract_fid_docid_facet_values.rs index 030303cd9..caf53550c 100644 --- a/milli/src/update/index_documents/extract/extract_fid_docid_facet_values.rs +++ b/milli/src/update/index_documents/extract/extract_fid_docid_facet_values.rs @@ -45,7 +45,6 @@ pub fn extract_fid_docid_facet_values( obkv_documents: grenad::Reader, indexer: GrenadParameters, settings_diff: &InnerIndexSettingsDiff, - geo_fields_ids: Option<(FieldId, FieldId)>, ) -> Result { puffin::profile_function!(); @@ -127,12 +126,18 @@ pub fn extract_fid_docid_facet_values( add_exists.insert(document); } - let geo_support = - geo_fields_ids.map_or(false, |(lat, lng)| field_id == lat || field_id == lng); + let del_geo_support = settings_diff + .old + .geo_fields_ids + .map_or(false, |(lat, lng)| field_id == lat || field_id == lng); + let add_geo_support = settings_diff + .new + .geo_fields_ids + .map_or(false, |(lat, lng)| field_id == lat || field_id == lng); let del_filterable_values = - del_value.map(|value| extract_facet_values(&value, geo_support)); + del_value.map(|value| extract_facet_values(&value, del_geo_support)); let add_filterable_values = - add_value.map(|value| extract_facet_values(&value, geo_support)); + add_value.map(|value| extract_facet_values(&value, add_geo_support)); // Those closures are just here to simplify things a bit. let mut insert_numbers_diff = |del_numbers, add_numbers| { diff --git a/milli/src/update/index_documents/extract/extract_geo_points.rs b/milli/src/update/index_documents/extract/extract_geo_points.rs index 01d53be1a..cbbb4e20b 100644 --- a/milli/src/update/index_documents/extract/extract_geo_points.rs +++ b/milli/src/update/index_documents/extract/extract_geo_points.rs @@ -81,10 +81,10 @@ fn extract_lat_lng( let lng = document.get(lng_fid).map(KvReaderDelAdd::new).and_then(|r| r.get(deladd)); let (lat, lng) = match (lat, lng) { (Some(lat), Some(lng)) => (lat, lng), - (Some(lat), None) => { + (Some(_), None) => { return Err(GeoError::MissingLatitude { document_id: document_id() }.into()) } - (None, Some(lng)) => { + (None, Some(_)) => { return Err(GeoError::MissingLongitude { document_id: document_id() }.into()) } (None, None) => return Ok(None), diff --git a/milli/src/update/index_documents/extract/mod.rs b/milli/src/update/index_documents/extract/mod.rs index 35a4c4344..237e19b2a 100644 --- a/milli/src/update/index_documents/extract/mod.rs +++ b/milli/src/update/index_documents/extract/mod.rs @@ -310,6 +310,7 @@ fn send_and_extract_flattened_documents_data( if settings_diff.run_geo_indexing() { let documents_chunk_cloned = flattened_documents_chunk.clone(); let lmdb_writer_sx_cloned = lmdb_writer_sx.clone(); + let settings_diff = settings_diff.clone(); rayon::spawn(move || { let result = extract_geo_points(documents_chunk_cloned, indexer, primary_key_id, &settings_diff); @@ -351,7 +352,6 @@ fn send_and_extract_flattened_documents_data( flattened_documents_chunk.clone(), indexer, &settings_diff, - geo_fields_ids, )?; // send fid_docid_facet_numbers_chunk to DB writer diff --git a/milli/src/update/index_documents/mod.rs b/milli/src/update/index_documents/mod.rs index b4ab63def..01684a54a 100644 --- a/milli/src/update/index_documents/mod.rs +++ b/milli/src/update/index_documents/mod.rs @@ -324,9 +324,6 @@ where // get the primary key field id let primary_key_id = settings_diff.new.fields_ids_map.id(&primary_key).unwrap(); - // get the fid of the `_geo.lat` and `_geo.lng` fields. - let mut field_id_map = self.index.fields_ids_map(self.wtxn)?; - let pool_params = GrenadParameters { chunk_compression_type: self.indexer_config.chunk_compression_type, chunk_compression_level: self.indexer_config.chunk_compression_level, diff --git a/milli/src/update/settings.rs b/milli/src/update/settings.rs index 5c53e1324..dfbc42f6c 100644 --- a/milli/src/update/settings.rs +++ b/milli/src/update/settings.rs @@ -1191,7 +1191,7 @@ impl InnerIndexSettings { let stop_words = stop_words.map(|sw| sw.map_data(Vec::from).unwrap()); let allowed_separators = index.allowed_separators(rtxn)?; let dictionary = index.dictionary(rtxn)?; - let fields_ids_map = index.fields_ids_map(rtxn)?; + let mut fields_ids_map = index.fields_ids_map(rtxn)?; let user_defined_searchable_fields = index.user_defined_searchable_fields(rtxn)?; let user_defined_searchable_fields = user_defined_searchable_fields.map(|sf| sf.into_iter().map(String::from).collect()); From f7623078387899e3d2539c1ed80f9465930a683e Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Tue, 21 May 2024 13:44:20 +0200 Subject: [PATCH 4/6] Fix clippy --- .../src/update/index_documents/extract/extract_geo_points.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/milli/src/update/index_documents/extract/extract_geo_points.rs b/milli/src/update/index_documents/extract/extract_geo_points.rs index cbbb4e20b..b1746898e 100644 --- a/milli/src/update/index_documents/extract/extract_geo_points.rs +++ b/milli/src/update/index_documents/extract/extract_geo_points.rs @@ -43,10 +43,10 @@ pub fn extract_geo_points( // extract old version let del_lat_lng = - extract_lat_lng(&obkv, &settings_diff.old, DelAdd::Deletion, &document_id)?; + extract_lat_lng(&obkv, &settings_diff.old, DelAdd::Deletion, document_id)?; // extract new version let add_lat_lng = - extract_lat_lng(&obkv, &settings_diff.new, DelAdd::Addition, &document_id)?; + extract_lat_lng(&obkv, &settings_diff.new, DelAdd::Addition, document_id)?; if del_lat_lng != add_lat_lng { let mut obkv = KvWriterDelAdd::memory(); From 7fbb3bf8e846d7de3892b9f53436d04763a2d451 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Tue, 21 May 2024 15:13:03 +0000 Subject: [PATCH 5/6] Update version for the next release (v1.8.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 fad60e8da..ab060ac93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -494,7 +494,7 @@ checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "benchmarks" -version = "1.8.0" +version = "1.8.1" dependencies = [ "anyhow", "bytes", @@ -639,7 +639,7 @@ dependencies = [ [[package]] name = "build-info" -version = "1.8.0" +version = "1.8.1" dependencies = [ "anyhow", "time", @@ -1539,7 +1539,7 @@ dependencies = [ [[package]] name = "dump" -version = "1.8.0" +version = "1.8.1" dependencies = [ "anyhow", "big_s", @@ -1787,7 +1787,7 @@ dependencies = [ [[package]] name = "file-store" -version = "1.8.0" +version = "1.8.1" dependencies = [ "faux", "tempfile", @@ -1810,7 +1810,7 @@ dependencies = [ [[package]] name = "filter-parser" -version = "1.8.0" +version = "1.8.1" dependencies = [ "insta", "nom", @@ -1830,7 +1830,7 @@ dependencies = [ [[package]] name = "flatten-serde-json" -version = "1.8.0" +version = "1.8.1" dependencies = [ "criterion", "serde_json", @@ -1948,7 +1948,7 @@ dependencies = [ [[package]] name = "fuzzers" -version = "1.8.0" +version = "1.8.1" dependencies = [ "arbitrary", "clap", @@ -2442,7 +2442,7 @@ checksum = "206ca75c9c03ba3d4ace2460e57b189f39f43de612c2f85836e65c929701bb2d" [[package]] name = "index-scheduler" -version = "1.8.0" +version = "1.8.1" dependencies = [ "anyhow", "big_s", @@ -2638,7 +2638,7 @@ dependencies = [ [[package]] name = "json-depth-checker" -version = "1.8.0" +version = "1.8.1" dependencies = [ "criterion", "serde_json", @@ -3275,7 +3275,7 @@ checksum = "490cc448043f947bae3cbee9c203358d62dbee0db12107a74be5c30ccfd09771" [[package]] name = "meili-snap" -version = "1.8.0" +version = "1.8.1" dependencies = [ "insta", "md5", @@ -3284,7 +3284,7 @@ dependencies = [ [[package]] name = "meilisearch" -version = "1.8.0" +version = "1.8.1" dependencies = [ "actix-cors", "actix-http", @@ -3377,7 +3377,7 @@ dependencies = [ [[package]] name = "meilisearch-auth" -version = "1.8.0" +version = "1.8.1" dependencies = [ "base64 0.21.7", "enum-iterator", @@ -3396,7 +3396,7 @@ dependencies = [ [[package]] name = "meilisearch-types" -version = "1.8.0" +version = "1.8.1" dependencies = [ "actix-web", "anyhow", @@ -3426,7 +3426,7 @@ dependencies = [ [[package]] name = "meilitool" -version = "1.8.0" +version = "1.8.1" dependencies = [ "anyhow", "clap", @@ -3465,7 +3465,7 @@ dependencies = [ [[package]] name = "milli" -version = "1.8.0" +version = "1.8.1" dependencies = [ "arroy", "big_s", @@ -3906,7 +3906,7 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "permissive-json-pointer" -version = "1.8.0" +version = "1.8.1" dependencies = [ "big_s", "serde_json", @@ -6074,7 +6074,7 @@ dependencies = [ [[package]] name = "xtask" -version = "1.8.0" +version = "1.8.1" dependencies = [ "anyhow", "build-info", diff --git a/Cargo.toml b/Cargo.toml index 10996065a..eadef3a1b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ members = [ ] [workspace.package] -version = "1.8.0" +version = "1.8.1" authors = [ "Quentin de Quelen ", "Clément Renault ", From 27b75ec648f848964adb64a16c663a3dd1e2ee3c Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Wed, 29 May 2024 11:26:07 +0200 Subject: [PATCH 6/6] merge main into v1.8.1 --- milli/src/update/settings.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/milli/src/update/settings.rs b/milli/src/update/settings.rs index dfbc42f6c..d68bbb939 100644 --- a/milli/src/update/settings.rs +++ b/milli/src/update/settings.rs @@ -1166,6 +1166,10 @@ impl InnerIndexSettingsDiff { self.old.geo_fields_ids != self.new.geo_fields_ids || (!self.settings_update_only && self.new.geo_fields_ids.is_some()) } + + pub fn modified_faceted_fields(&self) -> HashSet { + &self.old.user_defined_faceted_fields ^ &self.new.user_defined_faceted_fields + } } #[derive(Clone)]