pub struct SearchIndex { /* private fields */ }Expand description
Search index for efficient dataset discovery
Implementations§
Source§impl SearchIndex
impl SearchIndex
pub fn new() -> Self
pub fn initialize(&mut self) -> Result<(), StatisticalError>
Sourcepub fn index(&mut self, entry: IndexEntry)
pub fn index(&mut self, entry: IndexEntry)
Add (or replace) an entry in the search index, keyed by entry_id.
Sourcepub fn search(&self, query: &str) -> Vec<&IndexEntry>
pub fn search(&self, query: &str) -> Vec<&IndexEntry>
Simple keyword search: returns entries whose keywords or metadata values contain the query (case-insensitive substring match).
Sourcepub fn search_engine(&self) -> &SearchEngine
pub fn search_engine(&self) -> &SearchEngine
Returns a reference to the underlying search engine configuration.
Sourcepub fn search_engine_mut(&mut self) -> &mut SearchEngine
pub fn search_engine_mut(&mut self) -> &mut SearchEngine
Returns a mutable reference to the search engine so callers can reconfigure its type or indexing strategy.
Sourcepub fn entry_count(&self) -> usize
pub fn entry_count(&self) -> usize
Returns the number of entries currently held in the index.
Sourcepub fn remove_entry(&mut self, entry_id: &str) -> Option<IndexEntry>
pub fn remove_entry(&mut self, entry_id: &str) -> Option<IndexEntry>
Remove an entry from the index by its id. Returns the removed entry if it existed.
Sourcepub fn get_entry(&self, entry_id: &str) -> Option<&IndexEntry>
pub fn get_entry(&self, entry_id: &str) -> Option<&IndexEntry>
Look up an entry by id.
Auto Trait Implementations§
impl Freeze for SearchIndex
impl RefUnwindSafe for SearchIndex
impl Send for SearchIndex
impl Sync for SearchIndex
impl Unpin for SearchIndex
impl UnsafeUnpin for SearchIndex
impl UnwindSafe for SearchIndex
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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