pub enum SearchMode<'a> {
FlatScan {
filter: Option<SearchPredicate<'a>>,
},
Graph {
filter: Option<SearchPredicate<'a>>,
},
InlineFilter {
filter: Box<dyn QueryLabelProvider<u32> + 'a>,
adaptive_l: Option<AdaptiveL>,
},
DiverseGraph {
filter: Option<SearchPredicate<'a>>,
params: DeterminantDiversityParams,
},
}Expand description
Top-level disk search mode.
Three variants encode the algorithm + filter combination:
FlatScan— brute-force linear scan, with or without an inline filter.Graph— plain greedy beam search; the optional filter is applied as a hard post-filter during reranking (no traversal-time effect).InlineFilter— label-filtered graph search; the predicate is consulted at visit time (not just during rerank).adaptive_l = Some(_)grows the beam mid-search if the observed match specificity is low.DiverseGraph— greedy graph search with determinant-diversity post-processing; selects a maximally diverse top-k from the candidate pool usingDeterminantDiversityParams. Optional hard post-filter is applied during the diversity selection step.
Variants§
FlatScan
Fields
filter: Option<SearchPredicate<'a>>Graph
Fields
filter: Option<SearchPredicate<'a>>InlineFilter
DiverseGraph
Implementations§
Source§impl<'a> SearchMode<'a>
impl<'a> SearchMode<'a>
Sourcepub fn flat_filtered<F>(predicate: F) -> Self
pub fn flat_filtered<F>(predicate: F) -> Self
Flat scan restricted to vectors that satisfy predicate.
Sourcepub fn graph_filtered<F>(predicate: F) -> Self
pub fn graph_filtered<F>(predicate: F) -> Self
Plain greedy graph search with a hard post-filter applied during reranking. Traversal is unaffected.
Sourcepub fn inline_filter<F>(predicate: F, adaptive_l: Option<AdaptiveL>) -> Self
pub fn inline_filter<F>(predicate: F, adaptive_l: Option<AdaptiveL>) -> Self
Inline label-filtered graph search. adaptive_l = Some(_) enables
mid-search beam widening; None runs inline tracking only (no
resizing).
The closure is wrapped in a generic adapter (FnLabelProvider<F>)
that implements QueryLabelProvider<u32>.
Sourcepub fn diverse_graph(params: DeterminantDiversityParams) -> Self
pub fn diverse_graph(params: DeterminantDiversityParams) -> Self
Greedy graph search with determinant-diversity post-processing. Selects a diverse top-k from the candidate pool found at L.
Sourcepub fn diverse_graph_filtered<F>(
predicate: F,
params: DeterminantDiversityParams,
) -> Self
pub fn diverse_graph_filtered<F>( predicate: F, params: DeterminantDiversityParams, ) -> Self
Greedy graph search with determinant-diversity post-processing and a hard post-filter. The filter is honored during the diverse-selection step (non-matching IDs are excluded from the final top-k).
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for SearchMode<'a>
impl<'a> !UnwindSafe for SearchMode<'a>
impl<'a> Freeze for SearchMode<'a>
impl<'a> Send for SearchMode<'a>
impl<'a> Sync for SearchMode<'a>
impl<'a> Unpin for SearchMode<'a>
impl<'a> UnsafeUnpin for SearchMode<'a>
Blanket Implementations§
impl<T> AsyncFriendly for T
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> 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