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§
Sourcefn load(&mut self) -> Result<(), Error>
fn load(&mut self) -> Result<(), Error>
Load the module. This MUST be called (once) prior to calling expand_query().
Sourcefn expand_query(
&self,
terms: &Vec<Term<'_>>,
queryparams: &QueryParams,
) -> Result<TermExpansions, Error>
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.