[][src]Trait bindle::search::Search

pub trait Search {
#[must_use]    pub fn query<'life0, 'async_trait>(
        &'life0 self,
        term: String,
        filter: String,
        options: SearchOptions
    ) -> Pin<Box<dyn Future<Output = Result<Matches>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] pub fn index<'life0, 'life1, 'async_trait>(
        &'life0 self,
        document: &'life1 Invoice
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }

This trait describes the minimal set of features a Bindle provider must implement to provide query support.

Implementors of this trait should handle any locking of the internal index in their implementation Please note that due to this being an async_trait, the types might look complicated. Look at the code directly to see the simpler function signatures for implementation

Required methods

#[must_use]pub fn query<'life0, 'async_trait>(
    &'life0 self,
    term: String,
    filter: String,
    options: SearchOptions
) -> Pin<Box<dyn Future<Output = Result<Matches>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

A high-level function that can take raw search strings (queries and filters) and options.

This will parse the terms and filters according to its internal rules, and return a set of matches.

An error is returned if either there is something incorrect in the terms/filters, or if the search engine itself fails to process the query.

#[must_use]pub fn index<'life0, 'life1, 'async_trait>(
    &'life0 self,
    document: &'life1 Invoice
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Given an invoice, extract information from it that will be useful for searching.

This high-level feature does not provide any guarantees about how it will process the invoice. But it may implement Strict and/or Standard modes described in the protocol specification.

If the index function is given an invoice it has already indexed, it treats the call as an update. Otherwise, it adds a new entry to the index.

As a special note, if an invoice is yanked, the index function will mark it as such, following the protocol specification's requirements for yanked invoices.

Loading content...

Implementors

impl Search for StrictEngine[src]

Loading content...