#[non_exhaustive]pub struct Query { /* private fields */ }Expand description
A search query.
Implementations§
Source§impl Query
impl Query
Sourcepub fn hierarchical(self) -> Self
pub fn hierarchical(self) -> Self
Plan 10: opt into hierarchical descent. The search starts at the
configured scope (or the tenant root if unset) and descends through
internal nodes, scoring child summaries at each level and pruning
branches whose top scores fall below Query::prune_threshold.
Leaves are searched only after the parent’s index has identified
them as relevant. Defaults to flat (whole-tree) search when off.
Sourcepub fn prune_threshold(self, t: f32) -> Self
pub fn prune_threshold(self, t: f32) -> Self
Plan 10: prune children whose mid-level summary score is below t.
Default is no pruning — every child whose score made the top-K of the
parent’s index is descended into. Clamped to [-1, 1] (cosine range).
Sourcepub fn descend_factor(self, n: u32) -> Self
pub fn descend_factor(self, n: u32) -> Self
Plan 10: at each internal level, descend into the top
k * descend_factor children. Higher = wider beam = slower but more
recall; lower = narrower beam = faster but more risk of pruning the
right answer. Default 4. Clamped to >= 1.
Sourcepub fn is_hierarchical(&self) -> bool
pub fn is_hierarchical(&self) -> bool
Whether this query is in hierarchical mode.
Sourcepub fn within(self, path: PartitionPath) -> Self
pub fn within(self, path: PartitionPath) -> Self
Restrict the search to a partition (and its descendants).
Sourcepub fn with_embedding(self, vector: Vec<f32>) -> Self
pub fn with_embedding(self, vector: Vec<f32>) -> Self
Caller hands the engine a pre-computed query vector. Used by caller-owned-models pathways (Apple Foundation Models, OpenAI proxies, Swift FFI consumers) where the model runs outside the library on the query side.
When set, the engine bypasses its Embedder (if any) for the query
step. The vector’s length must match schema_meta.embedder_dims;
mismatch surfaces from the underlying vector index. Has no effect on
QueryMode::Text (lexical search ignores the vector).
See spec § 12 (caller-owned models) and § 12.13.
Sourcepub fn precomputed_embedding(&self) -> Option<&[f32]>
pub fn precomputed_embedding(&self) -> Option<&[f32]>
Borrow the precomputed query vector, if any. None means the engine
must invoke its configured Embedder to derive the query vector.
Sourcepub fn scope(&self) -> Option<&PartitionPath>
pub fn scope(&self) -> Option<&PartitionPath>
Borrow the partition restriction (if any).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
impl UnwindSafe for Query
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
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>
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>
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