pub trait QueryExpander: Send + Sync {
// Required methods
fn expand_query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
options: &'life2 ExpansionOptions,
) -> Pin<Box<dyn Future<Output = RragResult<ExpansionResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn expand_terms<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
terms: &'life1 [String],
options: &'life2 ExpansionOptions,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn find_related_entities<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
entities: &'life1 [String],
options: &'life2 ExpansionOptions,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get_suggestions<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
max_suggestions: usize,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Query expander trait for different expansion strategies
Required Methods§
Sourcefn expand_query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
options: &'life2 ExpansionOptions,
) -> Pin<Box<dyn Future<Output = RragResult<ExpansionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn expand_query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
query: &'life1 str,
options: &'life2 ExpansionOptions,
) -> Pin<Box<dyn Future<Output = RragResult<ExpansionResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Expand a text query using the knowledge graph
Sourcefn expand_terms<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
terms: &'life1 [String],
options: &'life2 ExpansionOptions,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn expand_terms<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
terms: &'life1 [String],
options: &'life2 ExpansionOptions,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Expand query terms using graph structure
Find related entities for query expansion
Sourcefn get_suggestions<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
max_suggestions: usize,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_suggestions<'life0, 'life1, 'async_trait>(
&'life0 self,
query: &'life1 str,
max_suggestions: usize,
) -> Pin<Box<dyn Future<Output = RragResult<Vec<String>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get expansion suggestions for a query