pub struct PathIndex { /* private fields */ }Expand description
One index, over one path.
Implementations§
Source§impl PathIndex
impl PathIndex
Sourcepub fn postings(&self) -> usize
pub fn postings(&self) -> usize
How many document ids are filed altogether.
One per document that has a scalar at this path, so the difference between this and the collection’s length is how many documents the index does not cover.
Sourcepub fn get(&self, key: &Key) -> Option<&Set>
pub fn get(&self, key: &Key) -> Option<&Set>
The documents filed under key.
A Set, so it can be intersected with another one by the same code
SINTER uses.
Sourcepub fn count(&self, key: &Key) -> usize
pub fn count(&self, key: &Key) -> usize
How many documents are filed under key.
The number a query planner sorts its filters by, and it is a probe rather than a walk.
Sourcepub fn range(&self, lo: Bound<&Key>, hi: Bound<&Key>) -> Ranged<'_> ⓘ
pub fn range(&self, lo: Bound<&Key>, hi: Bound<&Key>) -> Ranged<'_> ⓘ
Every key between lo and hi with the documents filed under it, in
order.
One descent of the tree and then a link per leaf, so a range of a thousand keys costs one search and a handful of hops. An equality index has no order to walk and answers nothing at all rather than pretending to have a range; the layer above turns that into an error, because a range query that silently finds nothing is worse than one that says no.
Sourcepub fn range_rev(&self, lo: Bound<&Key>, hi: Bound<&Key>) -> RangedRev<'_> ⓘ
pub fn range_rev(&self, lo: Bound<&Key>, hi: Bound<&Key>) -> RangedRev<'_> ⓘ
PathIndex::range backwards, largest key first.
Sourcepub fn count_in(&self, lo: Bound<&Key>, hi: Bound<&Key>) -> usize
pub fn count_in(&self, lo: Bound<&Key>, hi: Bound<&Key>) -> usize
How many documents are filed under any key between lo and hi.
This reads the keys in the range and not the documents, so it costs the number of distinct values rather than the number of postings.
Sourcepub fn memory_bytes(&self) -> usize
pub fn memory_bytes(&self) -> usize
What the index costs, posting lists and the order included.