fix facet distribution case

This commit is contained in:
mpostma
2020-06-26 12:59:20 +02:00
parent fb69769991
commit 18a50b4dac
4 changed files with 67 additions and 30 deletions

View File

@ -97,16 +97,14 @@ impl<'c, 'f, 'd, 'i> QueryBuilder<'c, 'f, 'd, 'i> {
.unwrap_or_default();
ors.push(docids);
}
let sets: Vec<_> = ors.iter().map(Cow::deref).collect();
let or_result = sdset::multi::OpBuilder::from_vec(sets)
.union()
.into_set_buf();
let sets: Vec<_> = ors.iter().map(|i| &i.1).map(Cow::deref).collect();
let or_result = sdset::multi::OpBuilder::from_vec(sets).union().into_set_buf();
ands.push(Cow::Owned(or_result));
ors.clear();
}
Either::Right(key) => {
match self.index.facets.facet_document_ids(reader, &key)? {
Some(docids) => ands.push(docids),
Some(docids) => ands.push(docids.1),
// no candidates for search, early return.
None => return Ok(Some(SetBuf::default())),
}