Skip to content
This repository was archived by the owner on Apr 4, 2023. It is now read-only.

Commit 52a7e10

Browse files
committed
Revert behaviour of facet distribution to what it was before
Where the docid that is used to get the original facet string value definitely belongs to the candidates
1 parent 3cf459e commit 52a7e10

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

milli/src/search/facet/facet_distribution_iter.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,12 @@ where
7474
if key.field_id != self.field_id {
7575
return Ok(ControlFlow::Break(()));
7676
}
77-
// TODO: use real intersection and then take min()?
78-
let docids_in_common = value.bitmap.intersection_len(candidates);
79-
if docids_in_common > 0 {
80-
// TODO: use min()
81-
let any_docid = value.bitmap.iter().next().unwrap();
82-
match (self.callback)(key.left_bound, docids_in_common, any_docid)? {
83-
ControlFlow::Continue(_) => (), // TODO use unit instead of empty scope
77+
let docids_in_common = value.bitmap & candidates;
78+
if !docids_in_common.is_empty() {
79+
let any_docid_in_common = docids_in_common.min().unwrap();
80+
match (self.callback)(key.left_bound, docids_in_common.len(), any_docid_in_common)?
81+
{
82+
ControlFlow::Continue(_) => (),
8483
ControlFlow::Break(_) => return Ok(ControlFlow::Break(())),
8584
}
8685
}

0 commit comments

Comments
 (0)