Skip to main content

HybridSearch

Struct HybridSearch 

Source
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

Source

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.

Source

pub fn top_k(self, k: usize) -> Self

Source

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.

Source

pub fn rrf_k(self, k: usize) -> Self

Override the RRF damping constant. See RRF_K.

Source

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.

Source

pub async fn execute(&self, conn: &Connection) -> Result<Vec<HybridHit>>

Run both arms and fuse them (§5.9).

Trait Implementations§

Source§

impl Clone for HybridSearch

Source§

fn clone(&self) -> HybridSearch

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HybridSearch

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more