impl seek_exact on union

This commit is contained in:
Pascal Seitz
2024-11-14 10:32:38 +09:00
committed by Pascal Seitz
parent e5bf84c7d0
commit a0123192c8

View File

@@ -217,6 +217,18 @@ where
}
}
fn seek_exact(&mut self, target: DocId) -> bool {
let is_hit = self
.docsets
.iter_mut()
.all(|docset| docset.seek_exact(target));
// The API requires the DocSet to be in a valid state when `seek_exact` returns true.
if is_hit {
self.seek(target);
}
is_hit
}
fn doc(&self) -> DocId {
self.doc
}