pub struct SearchIndex<S: Store> { /* private fields */ }Implementations§
Source§impl<S: Store> SearchIndex<S>
impl<S: Store> SearchIndex<S>
pub fn new(store: Arc<S>, options: SearchIndexOptions) -> Self
pub fn parse_keywords(&self, text: &str) -> Vec<String>
pub async fn index( &self, root: Option<&Cid>, prefix: &str, terms: &[String], id: &str, value: &str, ) -> Result<Cid, SearchError>
pub async fn remove( &self, root: &Cid, prefix: &str, terms: &[String], id: &str, ) -> Result<Option<Cid>, SearchError>
pub async fn search( &self, root: Option<&Cid>, prefix: &str, query: &str, options: SearchOptions, ) -> Result<Vec<SearchResult>, SearchError>
pub async fn merge( &self, base: Option<&Cid>, other: Option<&Cid>, prefer_other: bool, ) -> Result<Option<Cid>, SearchError>
pub async fn index_link( &self, root: Option<&Cid>, prefix: &str, terms: &[String], id: &str, target_cid: &Cid, ) -> Result<Cid, SearchError>
pub async fn remove_link( &self, root: &Cid, prefix: &str, terms: &[String], id: &str, ) -> Result<Option<Cid>, SearchError>
pub async fn search_links( &self, root: Option<&Cid>, prefix: &str, query: &str, options: SearchOptions, ) -> Result<Vec<SearchLinkResult>, SearchError>
pub async fn merge_links( &self, base: Option<&Cid>, other: Option<&Cid>, prefer_other: bool, ) -> Result<Option<Cid>, SearchError>
Auto Trait Implementations§
impl<S> Freeze for SearchIndex<S>
impl<S> RefUnwindSafe for SearchIndex<S>where
S: RefUnwindSafe,
impl<S> Send for SearchIndex<S>
impl<S> Sync for SearchIndex<S>
impl<S> Unpin for SearchIndex<S>
impl<S> UnsafeUnpin for SearchIndex<S>
impl<S> UnwindSafe for SearchIndex<S>where
S: RefUnwindSafe,
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