Remove the hard limit on the number of facet values returned

This commit is contained in:
Kerollmops 2022-06-08 15:42:29 +02:00
parent 7313d6c533
commit bae4007447
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4

View File

@ -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
}