pub enum CandidateSpec<'a> {
ByKey,
Scalar {
field: &'a str,
},
Tokens {
field: &'a str,
},
ScalarOrElements {
field: &'a str,
},
NumericBucket {
field: &'a str,
tolerance: f64,
},
GeoGrid {
field: &'a str,
km: f64,
},
ScanAll {
field: &'a str,
},
VectorClusters {
field: &'a str,
min: f64,
},
Hnsw {
field: &'a str,
k: usize,
floor: Option<f64>,
},
Union(Vec<CandidateSpec<'a>>),
Intersect(Vec<CandidateSpec<'a>>),
}Variants§
ByKey
Scalar
Tokens
ScalarOrElements
Src side of a KeyMatch-rooted rule: the FK field’s scalar value, or —
when that value is a list — one bucket per string element (the first
MAX_KEYMATCH_LIST in stored order, non-strings skipped).
The reverse lookup always probes with a single key (the destination
node’s key), so a multi-valued FK has to fan out at index time: a src
node listing n keys sits in n buckets and is found through any of them.
A scalar value indexes exactly as CandidateSpec::Scalar does.
NumericBucket
GeoGrid
ScanAll
VectorClusters
IVF-Flat approximate candidate selection (legacy; still supported as
direct fallback — no longer the default for approximate: true).
k-means fitted over the indexed side’s vectors; candidates are members
of the P = max(1, ceil(k/16)) nearest centroids to the query vector.
NOT a superset of true positives — recall floor governs correctness.
Hnsw
HNSW approximate candidate selection (default for approximate: true).
Returns the k nearest vectors by cosine similarity from the in-tree
HNSW graph. Falls back to returning all tracked nodes when the graph
has no entry point (e.g. before any node is inserted, or when used
without calling init_hnsw).
Fields
Union(Vec<CandidateSpec<'a>>)
Union of multiple candidate specs, used for Any predicates.
Each branch of the Any predicate contributes its own candidate set
(key index, token index, numeric bucket, etc.); the resulting candidate
set is their union. Insert and remove recurse into every child spec so
the index stays coherent for all branches simultaneously.
Intersect(Vec<CandidateSpec<'a>>)
Intersection of multiple candidate specs, used for All predicates.
Each conjunct contributes its own candidate set; the result is their
intersection (empty child → empty). ScanAll children are skipped at
probe time (they are the universe); if every child is ScanAll, the
spec stays a full scan. Insert/remove recurse into every child.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for CandidateSpec<'a>
impl<'a> RefUnwindSafe for CandidateSpec<'a>
impl<'a> Send for CandidateSpec<'a>
impl<'a> Sync for CandidateSpec<'a>
impl<'a> Unpin for CandidateSpec<'a>
impl<'a> UnsafeUnpin for CandidateSpec<'a>
impl<'a> UnwindSafe for CandidateSpec<'a>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.