pub struct VectorSearchQuery {
pub embedding_space_id: EmbeddingSpaceId,
pub query: Vec<f32>,
pub k: usize,
pub channel_k: Option<usize>,
pub collection_filter: Option<HashSet<CollectionId>>,
pub fidelity: VectorFidelity,
}Expand description
Input to ValiseFile::vector_search.
Dispatch is implicit per embedding space: a QAM(5,6) space uses the
in-memory sign-sketch scan + QAM-sliding rerank; any other space falls back
to a full brute-force scan through the primary codec. See
docs/VECTOR_SEARCH.md for the pipeline and its recall/latency envelope.
Fields§
§embedding_space_id: EmbeddingSpaceId§query: Vec<f32>§k: usize§channel_k: Option<usize>Candidate budget for the sign-sketch scan: it keeps the channel_k
closest-by-Hamming vectors as rerank candidates. None uses
max(4 * k, DEFAULT_SKETCH_CANDIDATE_BUDGET), clamped to the active
count. Brute force (non-QAM(5,6) spaces) ignores it.
collection_filter: Option<HashSet<CollectionId>>Optional collection allowlist.
fidelity: VectorFidelityRerank fidelity over the sketch candidates. Lossy keeps the
QAM-sliding (i8) scores; Full adds an f32 rerank pass over the top
survivors. Recall is bounded by the codec’s reconstruction either way
(see docs/VECTOR_SEARCH.md); Full recovers the last ~3 points the
i8 scorer leaves on the table. Neither changes the candidate set — that
is channel_k’s job.
Implementations§
Source§impl VectorSearchQuery
impl VectorSearchQuery
Sourcepub fn accurate(
embedding_space_id: EmbeddingSpaceId,
query: Vec<f32>,
k: usize,
) -> Self
pub fn accurate( embedding_space_id: EmbeddingSpaceId, query: Vec<f32>, k: usize, ) -> Self
Accurate search: sketch-select the default candidate budget, then run
the f32 rerank pass (VectorFidelity::Full). Leaves channel_k unset
so it uses DEFAULT_SKETCH_CANDIDATE_BUDGET, which is sized to reach
the codec’s recall ceiling. Pass an explicit channel_k to trade
recall for latency. This is the engine-level target a higher layer’s
“accurate rerank” lowers to.
Sourcepub fn fast(
embedding_space_id: EmbeddingSpaceId,
query: Vec<f32>,
k: usize,
) -> Self
pub fn fast( embedding_space_id: EmbeddingSpaceId, query: Vec<f32>, k: usize, ) -> Self
Fast search: sketch-select the default candidate budget, keep the
QAM-sliding (i8) scores, no f32 rerank (VectorFidelity::Lossy).
~3 points lower recall than Self::accurate for less rerank work.
Trait Implementations§
Source§impl Clone for VectorSearchQuery
impl Clone for VectorSearchQuery
Auto Trait Implementations§
impl Freeze for VectorSearchQuery
impl RefUnwindSafe for VectorSearchQuery
impl Send for VectorSearchQuery
impl Sync for VectorSearchQuery
impl Unpin for VectorSearchQuery
impl UnsafeUnpin for VectorSearchQuery
impl UnwindSafe for VectorSearchQuery
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