kbolt-core 0.1.7

Core engine for kbolt local-first retrieval
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::Result;

pub(crate) fn normalize_query_text(query: &str) -> String {
    query.split_whitespace().collect::<Vec<_>>().join(" ")
}

pub(crate) trait Expander: Send + Sync {
    /// Returns ordered, unique generated queries for the given query.
    ///
    /// Implementations must not return the original query. The engine owns that baseline query
    /// and routes it through keyword and dense retrieval when available.
    fn expand(&self, query: &str, max_variants: usize) -> Result<Vec<String>>;
}