Module

Trait Module 

Source
pub trait Module: Send + Sync {
    // Required methods
    fn kind(&self) -> &'static str;
    fn id(&self) -> &str;
    fn name(&self) -> &str;
    fn load(&mut self) -> Result<(), Error>;
    fn expand_query(
        &self,
        terms: &Vec<Term<'_>>,
        queryparams: &QueryParams,
    ) -> Result<TermExpansions, Error>;
}
Expand description

This trait is implemented for all query expansions modules

Required Methods§

Source

fn kind(&self) -> &'static str

Get the module type

Source

fn id(&self) -> &str

Get the module identifier, some arbititrary short string

Source

fn name(&self) -> &str

Get the module name, a human-readable label

Source

fn load(&mut self) -> Result<(), Error>

Load the module. This MUST be called (once) prior to calling expand_query().

Source

fn expand_query( &self, terms: &Vec<Term<'_>>, queryparams: &QueryParams, ) -> Result<TermExpansions, Error>

Expands a (decomposed) query. Note that load() MUST be called (once) prior to calling this for the first time, otherwise it will result in a panic.

Implementors§