pub struct SortedIndexes { /* private fields */ }Expand description
In-memory sorted index per (collection, field). Rebuilt from object store on startup. O(log n) ORDER BY queries.
Implementations§
Source§impl SortedIndexes
impl SortedIndexes
pub fn new() -> Self
Sourcepub fn ensure(&self, coll: &str, field: &str)
pub fn ensure(&self, coll: &str, field: &str)
Register a field as sorted-indexed for a collection. Must be called before any puts for that field to be indexed.
Sourcepub fn insert(&self, coll: &str, field: &str, value: &Value, hash: &str)
pub fn insert(&self, coll: &str, field: &str, value: &Value, hash: &str)
Insert (or update) a value → hash mapping.
Sourcepub fn remove(&self, coll: &str, field: &str, value: &Value, hash: &str)
pub fn remove(&self, coll: &str, field: &str, value: &Value, hash: &str)
Remove a hash from the index (on overwrite/delete of a doc version).
Sourcepub fn top_k_asc(&self, coll: &str, field: &str, k: usize) -> Vec<String>
pub fn top_k_asc(&self, coll: &str, field: &str, k: usize) -> Vec<String>
Return the top-k hashes ordered by field ASC.
Sourcepub fn top_k_desc(&self, coll: &str, field: &str, k: usize) -> Vec<String>
pub fn top_k_desc(&self, coll: &str, field: &str, k: usize) -> Vec<String>
Return the top-k hashes ordered by field DESC.
Auto Trait Implementations§
impl !RefUnwindSafe for SortedIndexes
impl Freeze for SortedIndexes
impl Send for SortedIndexes
impl Sync for SortedIndexes
impl Unpin for SortedIndexes
impl UnsafeUnpin for SortedIndexes
impl UnwindSafe for SortedIndexes
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more