Skip to main content

PathIndex

Struct PathIndex 

Source
pub struct PathIndex { /* private fields */ }
Expand description

One index, over one path.

Implementations§

Source§

impl PathIndex

Source

pub fn path(&self) -> &[u8]

The path this indexes.

Source

pub fn kind(&self) -> IndexKind

What this index can be asked.

Source

pub fn len(&self) -> usize

How many distinct values are filed.

Source

pub fn is_empty(&self) -> bool

Whether nothing is filed.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn range_rev(&self, lo: Bound<&Key>, hi: Bound<&Key>) -> RangedRev<'_>

PathIndex::range backwards, largest key first.

Source

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.

Source

pub fn memory_bytes(&self) -> usize

What the index costs, posting lists and the order included.

Trait Implementations§

Source§

impl Debug for PathIndex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.