pub struct SearchPolicy {
pub expansion: usize,
pub routing_probes: usize,
}Expand description
Per-query approximation policy.
Increasing expansion explores more graph nodes. Increasing
routing_probes recovers more candidates from nearby deterministic routing
buckets, which is useful when graph expansion alone no longer improves
recall.
Fields§
§expansion: usizeMinimum number of graph candidates retained per replica.
routing_probes: usizeNumber of deterministic routing buckets probed after graph traversal.
Values from 1 through Self::MAX_ROUTING_PROBES are supported.
Implementations§
Source§impl SearchPolicy
impl SearchPolicy
Sourcepub const MAX_ROUTING_PROBES: usize = VECTOR_MAX_ROUTING_PROBES
pub const MAX_ROUTING_PROBES: usize = VECTOR_MAX_ROUTING_PROBES
Largest supported routing recovery width.
Sourcepub const fn new(expansion: usize) -> Self
pub const fn new(expansion: usize) -> Self
Creates the low-overhead default policy used by
crate::VectorIndex::search.
Sourcepub const fn high_recall(expansion: usize) -> Self
pub const fn high_recall(expansion: usize) -> Self
Creates a stronger deterministic recovery policy for recall-sensitive queries.
Sourcepub const fn with_routing_probes(self, routing_probes: usize) -> Self
pub const fn with_routing_probes(self, routing_probes: usize) -> Self
Changes only the routing recovery width.
Trait Implementations§
Source§impl Clone for SearchPolicy
impl Clone for SearchPolicy
Source§fn clone(&self) -> SearchPolicy
fn clone(&self) -> SearchPolicy
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SearchPolicy
Source§impl Debug for SearchPolicy
impl Debug for SearchPolicy
impl Eq for SearchPolicy
Source§impl PartialEq for SearchPolicy
impl PartialEq for SearchPolicy
impl StructuralPartialEq for SearchPolicy
Auto Trait Implementations§
impl Freeze for SearchPolicy
impl RefUnwindSafe for SearchPolicy
impl Send for SearchPolicy
impl Sync for SearchPolicy
impl Unpin for SearchPolicy
impl UnsafeUnpin for SearchPolicy
impl UnwindSafe for SearchPolicy
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
Mutably borrows from an owned value. Read more