From bae400744738d5cfc253a46ce058fbc9d90fd71d Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 8 Jun 2022 15:42:29 +0200 Subject: [PATCH 1/2] Remove the hard limit on the number of facet values returned --- milli/src/search/facet/facet_distribution.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/milli/src/search/facet/facet_distribution.rs b/milli/src/search/facet/facet_distribution.rs index 23b0b1df9..7340538ea 100644 --- a/milli/src/search/facet/facet_distribution.rs +++ b/milli/src/search/facet/facet_distribution.rs @@ -1,6 +1,6 @@ use std::collections::{BTreeMap, HashSet}; use std::ops::Bound::Unbounded; -use std::{cmp, fmt, mem}; +use std::{fmt, mem}; use heed::types::ByteSlice; use roaring::RoaringBitmap; @@ -17,10 +17,6 @@ use crate::{FieldId, Index, Result}; /// be fetched from the key-value store. const DEFAULT_VALUES_BY_FACET: usize = 1000; -/// The hard limit in the number of values by facets that will be fetched from -/// the key-value store. Searching for more values could slow down the engine. -const MAX_VALUES_BY_FACET: usize = 10000; - /// Threshold on the number of candidates that will make /// the system to choose between one algorithm or another. const CANDIDATES_THRESHOLD: u64 = 3000; @@ -50,7 +46,7 @@ impl<'a> FacetDistribution<'a> { } pub fn max_values_by_facet(&mut self, max: usize) -> &mut Self { - self.max_values_by_facet = cmp::min(max, MAX_VALUES_BY_FACET); + self.max_values_by_facet = max; self } From 2a505503b3fbeef66dab0735a062e33567eac64d Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 8 Jun 2022 15:43:01 +0200 Subject: [PATCH 2/2] Change the number of facet values returned by default to 100 --- milli/src/search/facet/facet_distribution.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/milli/src/search/facet/facet_distribution.rs b/milli/src/search/facet/facet_distribution.rs index 7340538ea..8069abede 100644 --- a/milli/src/search/facet/facet_distribution.rs +++ b/milli/src/search/facet/facet_distribution.rs @@ -15,7 +15,7 @@ use crate::{FieldId, Index, Result}; /// The default number of values by facets that will /// be fetched from the key-value store. -const DEFAULT_VALUES_BY_FACET: usize = 1000; +const DEFAULT_VALUES_BY_FACET: usize = 100; /// Threshold on the number of candidates that will make /// the system to choose between one algorithm or another.