pub struct HybridSearch { /* private fields */ }Expand description
A hybrid search over one model’s vectors and the concept-text index (§5.9).
Mirrors crate::graph::FilteredVectorSearch and TraversalBuilder, which
is the crate’s shape for a read with options.
Implementations§
Source§impl HybridSearch
impl HybridSearch
Sourcepub fn new(
model: ModelName,
query_text: impl Into<String>,
query_vector: Vec<f32>,
) -> Self
pub fn new( model: ModelName, query_text: impl Into<String>, query_vector: Vec<f32>, ) -> Self
query_text feeds the keyword arm, query_vector the vector arm. They
are separate parameters because the crate does not embed text — that is
the caller’s model, run in the caller’s process (Doctrine VII), and the
two arms may legitimately be given different framings of one question.
pub fn top_k(self, k: usize) -> Self
Sourcepub fn depth(self, depth: usize) -> Self
pub fn depth(self, depth: usize) -> Self
How deep to read each arm before fusing. Defaults to max(5 × top_k, 50).
Fusing two top-k lists is not the same as the top k of the fusion: a
document ranked 12th by both arms can outscore one ranked 1st by a single
arm, and it is invisible if neither list was read past 10. Depth is what
buys those, and it costs one larger LIMIT per arm rather than an extra
round trip.
Sourcepub fn raw_match(self, raw: bool) -> Self
pub fn raw_match(self, raw: bool) -> Self
Pass query_text to FTS5 verbatim instead of escaping it.
Opt-in, because it hands the caller’s string to a query language: a
malformed expression becomes an engine error and NOT silently changes
what was asked. Correct for a caller building the expression themselves;
wrong for anything typed into a search box.
Trait Implementations§
Source§impl Clone for HybridSearch
impl Clone for HybridSearch
Source§fn clone(&self) -> HybridSearch
fn clone(&self) -> HybridSearch
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for HybridSearch
impl RefUnwindSafe for HybridSearch
impl Send for HybridSearch
impl Sync for HybridSearch
impl Unpin for HybridSearch
impl UnsafeUnpin for HybridSearch
impl UnwindSafe for HybridSearch
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request