pub struct HybridQueryBuilder<'a> { /* private fields */ }Expand description
Builder for hybrid queries
Implementations§
Source§impl<'a> HybridQueryBuilder<'a>
impl<'a> HybridQueryBuilder<'a>
Sourcepub fn with_vector(self, vector: Vec<f32>) -> HybridQueryBuilder<'a>
pub fn with_vector(self, vector: Vec<f32>) -> HybridQueryBuilder<'a>
Set the query vector for dense search
Sourcepub fn with_text(self, text: impl Into<String>) -> HybridQueryBuilder<'a>
pub fn with_text(self, text: impl Into<String>) -> HybridQueryBuilder<'a>
Set the query text for sparse search
Sourcepub fn with_both(
self,
vector: Vec<f32>,
text: impl Into<String>,
) -> HybridQueryBuilder<'a>
pub fn with_both( self, vector: Vec<f32>, text: impl Into<String>, ) -> HybridQueryBuilder<'a>
Set both vector and text
Sourcepub fn top_k(self, k: usize) -> HybridQueryBuilder<'a>
pub fn top_k(self, k: usize) -> HybridQueryBuilder<'a>
Set number of results to return
Sourcepub fn fusion(self, method: FusionMethod) -> HybridQueryBuilder<'a>
pub fn fusion(self, method: FusionMethod) -> HybridQueryBuilder<'a>
Set fusion method
Sourcepub fn rrf(self, k: usize) -> HybridQueryBuilder<'a>
pub fn rrf(self, k: usize) -> HybridQueryBuilder<'a>
Use RRF fusion
Sourcepub fn linear(self, alpha: f32) -> HybridQueryBuilder<'a>
pub fn linear(self, alpha: f32) -> HybridQueryBuilder<'a>
Use linear fusion with alpha weight for dense
Sourcepub fn filter_ids(self, ids: HashSet<u64>) -> HybridQueryBuilder<'a>
pub fn filter_ids(self, ids: HashSet<u64>) -> HybridQueryBuilder<'a>
Pre-filter by document IDs
Sourcepub fn filter_metadata(self, filter: MetadataFilter) -> HybridQueryBuilder<'a>
pub fn filter_metadata(self, filter: MetadataFilter) -> HybridQueryBuilder<'a>
Pre-filter by metadata
Sourcepub fn execute(self) -> Vec<HybridResult>
pub fn execute(self) -> Vec<HybridResult>
Execute the query
Auto Trait Implementations§
impl<'a> Freeze for HybridQueryBuilder<'a>
impl<'a> RefUnwindSafe for HybridQueryBuilder<'a>
impl<'a> Send for HybridQueryBuilder<'a>
impl<'a> Sync for HybridQueryBuilder<'a>
impl<'a> Unpin for HybridQueryBuilder<'a>
impl<'a> UnsafeUnpin for HybridQueryBuilder<'a>
impl<'a> UnwindSafe for HybridQueryBuilder<'a>
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
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request