Add settings to force milli to exhaustively compute the total number of hits

This commit is contained in:
ManyTheFish
2022-07-12 17:56:50 +02:00
parent fad0de4581
commit a396806343
5 changed files with 45 additions and 12 deletions

View File

@ -232,13 +232,15 @@ impl<'t> CriteriaBuilder<'t> {
primitive_query: Option<Vec<PrimitiveQueryPart>>,
filtered_candidates: Option<RoaringBitmap>,
sort_criteria: Option<Vec<AscDescName>>,
exhaustive_number_hits: bool,
) -> Result<Final<'t>> {
use crate::criterion::Criterion as Name;
let primitive_query = primitive_query.unwrap_or_default();
let mut criterion =
Box::new(Initial::new(query_tree, filtered_candidates)) as Box<dyn Criterion>;
Box::new(Initial::new(self, query_tree, filtered_candidates, exhaustive_number_hits))
as Box<dyn Criterion>;
for name in self.index.criteria(&self.rtxn)? {
criterion = match name {
Name::Words => Box::new(Words::new(self, criterion)),