pub struct QueryEngine { /* private fields */ }Expand description
Query engine for executing vector searches
Implementations§
Source§impl QueryEngine
impl QueryEngine
Sourcepub fn new(config: EngineConfig) -> Result<Self>
pub fn new(config: EngineConfig) -> Result<Self>
Create a new query engine
Sourcepub fn load_segment(&mut self, path: &str) -> Result<()>
pub fn load_segment(&mut self, path: &str) -> Result<()>
Load a segment from file
Sourcepub fn search(&self, query: &[f32], params: &QueryParams) -> Result<QueryResult>
pub fn search(&self, query: &[f32], params: &QueryParams) -> Result<QueryResult>
Execute a query
Sourcepub fn verify(
&self,
segment: &Segment,
candidates: &[ScoredCandidate],
query: &[f32],
k: usize,
) -> Vec<ScoredCandidate>
pub fn verify( &self, segment: &Segment, candidates: &[ScoredCandidate], query: &[f32], k: usize, ) -> Vec<ScoredCandidate>
Optional verification with fp32
Sourcepub fn total_vectors(&self) -> u32
pub fn total_vectors(&self) -> u32
Get total vector count across all segments
Sourcepub fn config(&self) -> &EngineConfig
pub fn config(&self) -> &EngineConfig
Get config
Auto Trait Implementations§
impl Freeze for QueryEngine
impl RefUnwindSafe for QueryEngine
impl Send for QueryEngine
impl Sync for QueryEngine
impl Unpin for QueryEngine
impl UnsafeUnpin for QueryEngine
impl UnwindSafe for QueryEngine
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more