Skip to main content

SearchEngine

Trait SearchEngine 

Source
pub trait SearchEngine:
    Send
    + Sync
    + 'static {
    // Required methods
    fn matching<'a>(
        &'a self,
        index: &'a SearchIndex,
        words: &'a str,
        owner: Option<Uuid>,
    ) -> BoxFuture<'a, Result<Vec<Uuid>>>;
    fn put<'a>(
        &'a self,
        index: &'a SearchIndex,
        documents: &'a [Document],
    ) -> BoxFuture<'a, Result<()>>;
    fn remove<'a>(
        &'a self,
        index: &'a SearchIndex,
        ids: &'a [Uuid],
    ) -> BoxFuture<'a, Result<()>>;
}

Required Methods§

Source

fn matching<'a>( &'a self, index: &'a SearchIndex, words: &'a str, owner: Option<Uuid>, ) -> BoxFuture<'a, Result<Vec<Uuid>>>

Best first; with an owner, only that owner’s.

Source

fn put<'a>( &'a self, index: &'a SearchIndex, documents: &'a [Document], ) -> BoxFuture<'a, Result<()>>

Returns once the engine has taken them, which may be before they are found.

Source

fn remove<'a>( &'a self, index: &'a SearchIndex, ids: &'a [Uuid], ) -> BoxFuture<'a, Result<()>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§