pub struct SearchIndex { /* private fields */ }Expand description
Search index for fast lookups.
Implementations§
Source§impl SearchIndex
impl SearchIndex
Sourcepub fn build(entries: &[MemoryEntry]) -> Self
pub fn build(entries: &[MemoryEntry]) -> Self
Build index from entries.
Sourcepub fn search(
&self,
_entries: &[MemoryEntry],
query_lower: &str,
limit: Option<usize>,
) -> Vec<usize>
pub fn search( &self, _entries: &[MemoryEntry], query_lower: &str, limit: Option<usize>, ) -> Vec<usize>
Search by query with optional limit.
Sourcepub fn search_multi(&self, keywords_lower: &[String]) -> Vec<usize>
pub fn search_multi(&self, keywords_lower: &[String]) -> Vec<usize>
Multi-keyword search (matches any keyword).
Trait Implementations§
Source§impl Clone for SearchIndex
impl Clone for SearchIndex
Source§fn clone(&self) -> SearchIndex
fn clone(&self) -> SearchIndex
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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§
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