pub struct QueryExecutor {
store: Arc<dyn VectorStore>,
embedder: Arc<dyn Embedder>,
parser: QueryParser,
hybrid: bool,
max_limit: usize,
scope_prefix: Option<String>,
}Expand description
Query executor.
Fields§
§store: Arc<dyn VectorStore>Vector store
embedder: Arc<dyn Embedder>Embedder for query embedding
parser: QueryParserQuery parser
hybrid: boolWhether to use hybrid search
max_limit: usizeUpper bound applied to parsed / CLI limits
scope_prefix: Option<String>Optional directory scope, relative to the index root
Implementations§
Source§impl QueryExecutor
impl QueryExecutor
Sourcepub fn new(
store: Arc<dyn VectorStore>,
embedder: Arc<dyn Embedder>,
default_limit: usize,
hybrid: bool,
) -> Self
pub fn new( store: Arc<dyn VectorStore>, embedder: Arc<dyn Embedder>, default_limit: usize, hybrid: bool, ) -> Self
Create a new query executor.
Sourcepub fn with_max_limit(self, max_limit: usize) -> Self
pub fn with_max_limit(self, max_limit: usize) -> Self
Clamp result counts to max_limit from [query].max_limit.
Sourcepub fn with_scope(self, scope: Option<String>) -> Self
pub fn with_scope(self, scope: Option<String>) -> Self
Restrict search to a directory (relative to the index root) and its subdirectories.
fn clamp_limit(&self, limit: usize) -> usize
Sourcepub async fn execute(&self, query_str: &str) -> Result<Vec<SearchResult>, Error>
pub async fn execute(&self, query_str: &str) -> Result<Vec<SearchResult>, Error>
Execute a query string.
Sourcepub async fn execute_parsed(
&self,
parsed: ParsedQuery,
) -> Result<Vec<SearchResult>, Error>
pub async fn execute_parsed( &self, parsed: ParsedQuery, ) -> Result<Vec<SearchResult>, Error>
Execute with a pre-parsed query.
Auto Trait Implementations§
impl !RefUnwindSafe for QueryExecutor
impl !UnwindSafe for QueryExecutor
impl Freeze for QueryExecutor
impl Send for QueryExecutor
impl Sync for QueryExecutor
impl Unpin for QueryExecutor
impl UnsafeUnpin for QueryExecutor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more