pub struct UnifiedHybridQuery {
pub namespace: NamespaceScope,
pub vector_query: Option<VectorQuerySpec>,
pub bm25_query: Option<Bm25QuerySpec>,
pub filter: FilterIR,
pub fusion_config: FusionConfig,
}Expand description
A hybrid query that enforces pre-filtering
Fields§
§namespace: NamespaceScopeNamespace scope (mandatory)
vector_query: Option<VectorQuerySpec>Vector query (optional)
bm25_query: Option<Bm25QuerySpec>BM25 query (optional)
filter: FilterIRUser-provided filter
fusion_config: FusionConfigFusion configuration
Implementations§
Source§impl UnifiedHybridQuery
impl UnifiedHybridQuery
Sourcepub fn new(namespace: NamespaceScope) -> Self
pub fn new(namespace: NamespaceScope) -> Self
Create a new hybrid query (namespace is mandatory)
Sourcepub fn with_vector(self, embedding: Vec<f32>) -> Self
pub fn with_vector(self, embedding: Vec<f32>) -> Self
Add vector search
Sourcepub fn with_filter(self, filter: FilterIR) -> Self
pub fn with_filter(self, filter: FilterIR) -> Self
Add filter
Sourcepub fn with_fusion(self, config: FusionConfig) -> Self
pub fn with_fusion(self, config: FusionConfig) -> Self
Set fusion config
Sourcepub fn effective_filter(&self) -> FilterIR
pub fn effective_filter(&self) -> FilterIR
Compute the complete effective filter
This combines namespace scope + user filter. Auth scope is added later.
Trait Implementations§
Source§impl Clone for UnifiedHybridQuery
impl Clone for UnifiedHybridQuery
Source§fn clone(&self) -> UnifiedHybridQuery
fn clone(&self) -> UnifiedHybridQuery
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for UnifiedHybridQuery
impl RefUnwindSafe for UnifiedHybridQuery
impl Send for UnifiedHybridQuery
impl Sync for UnifiedHybridQuery
impl Unpin for UnifiedHybridQuery
impl UnsafeUnpin for UnifiedHybridQuery
impl UnwindSafe for UnifiedHybridQuery
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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