diff --git a/Cargo.lock b/Cargo.lock index ff600110e..73114c7c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -901,7 +901,7 @@ dependencies = [ [[package]] name = "helpers" -version = "0.5.1" +version = "0.6.0" dependencies = [ "anyhow", "byte-unit", @@ -955,7 +955,7 @@ dependencies = [ [[package]] name = "http-ui" -version = "0.5.1" +version = "0.6.0" dependencies = [ "anyhow", "askama", @@ -1098,7 +1098,7 @@ dependencies = [ [[package]] name = "infos" -version = "0.5.1" +version = "0.6.0" dependencies = [ "anyhow", "byte-unit", @@ -1377,7 +1377,7 @@ dependencies = [ [[package]] name = "milli" -version = "0.5.1" +version = "0.6.0" dependencies = [ "big_s", "bstr", @@ -2232,7 +2232,7 @@ dependencies = [ [[package]] name = "search" -version = "0.5.1" +version = "0.6.0" dependencies = [ "anyhow", "byte-unit", diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index d211b0b6e..6d5c99950 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -4,7 +4,6 @@ version = "0.1.0" edition = "2018" publish = false - [dependencies] milli = { path = "../milli" } diff --git a/helpers/Cargo.toml b/helpers/Cargo.toml index eeabf6971..224b0e5eb 100644 --- a/helpers/Cargo.toml +++ b/helpers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "helpers" -version = "0.5.1" +version = "0.6.0" authors = ["Clément Renault "] edition = "2018" diff --git a/http-ui/Cargo.toml b/http-ui/Cargo.toml index d12b4363d..5e6ab9d09 100644 --- a/http-ui/Cargo.toml +++ b/http-ui/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "http-ui" description = "The HTTP user interface of the milli search engine" -version = "0.5.1" +version = "0.6.0" authors = ["Clément Renault "] edition = "2018" diff --git a/infos/Cargo.toml b/infos/Cargo.toml index bb548743c..d12036a07 100644 --- a/infos/Cargo.toml +++ b/infos/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "infos" -version = "0.5.1" +version = "0.6.0" authors = ["Clément Renault "] edition = "2018" diff --git a/milli/Cargo.toml b/milli/Cargo.toml index d708442dc..872c339ff 100644 --- a/milli/Cargo.toml +++ b/milli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "milli" -version = "0.5.1" +version = "0.6.0" authors = ["Kerollmops "] edition = "2018" diff --git a/milli/src/update/index_documents/store.rs b/milli/src/update/index_documents/store.rs index 766ed82b2..9ac97c255 100644 --- a/milli/src/update/index_documents/store.rs +++ b/milli/src/update/index_documents/store.rs @@ -55,7 +55,7 @@ pub struct Readers { pub struct Store<'s, A> { // Indexing parameters searchable_fields: HashSet, - faceted_fields: HashSet, + filterable_fields: HashSet, // Caches word_docids: LinkedHashMap, RoaringBitmap>, word_docids_limit: usize, @@ -90,7 +90,7 @@ pub struct Store<'s, A> { impl<'s, A: AsRef<[u8]>> Store<'s, A> { pub fn new( searchable_fields: HashSet, - faceted_fields: HashSet, + filterable_fields: HashSet, linked_hash_map_size: Option, max_nb_chunks: Option, max_memory: Option, @@ -190,7 +190,7 @@ impl<'s, A: AsRef<[u8]>> Store<'s, A> { Ok(Store { // Indexing parameters. searchable_fields, - faceted_fields, + filterable_fields, // Caches word_docids: LinkedHashMap::with_capacity(linked_hash_map_size), field_id_word_count_docids: HashMap::new(), @@ -668,20 +668,23 @@ impl<'s, A: AsRef<[u8]>> Store<'s, A> { } for (attr, content) in document.iter() { - if self.faceted_fields.contains(&attr) || self.searchable_fields.contains(&attr) + if self.filterable_fields.contains(&attr) + || self.searchable_fields.contains(&attr) { let value = serde_json::from_slice(content).map_err(InternalError::SerdeJson)?; - let (facet_numbers, facet_strings) = extract_facet_values(&value); - facet_numbers_values - .entry(attr) - .or_insert_with(Vec::new) - .extend(facet_numbers); - facet_strings_values - .entry(attr) - .or_insert_with(Vec::new) - .extend(facet_strings); + if self.filterable_fields.contains(&attr) { + let (facet_numbers, facet_strings) = extract_facet_values(&value); + facet_numbers_values + .entry(attr) + .or_insert_with(Vec::new) + .extend(facet_numbers); + facet_strings_values + .entry(attr) + .or_insert_with(Vec::new) + .extend(facet_strings); + } if self.searchable_fields.contains(&attr) { let content = match json_to_string(&value) { diff --git a/search/Cargo.toml b/search/Cargo.toml index 82368af92..bd1aba2dd 100644 --- a/search/Cargo.toml +++ b/search/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "search" -version = "0.5.1" +version = "0.6.0" authors = ["Clément Renault "] edition = "2018"