pub struct SearchParams {
pub top_k: usize,
pub n_probe: usize,
pub n_candidate_docs: Option<usize>,
pub centroid_score_threshold: Option<f32>,
}Expand description
Tunable knobs for a single search call.
Fields§
§top_k: usizeNumber of top-scoring documents to return.
n_probe: usizeNumber of top dot-product centroids each query token probes.
n_candidate_docs: Option<usize>Maximum number of candidates surviving PLAID’s
centroid-interaction stage that proceed to full decode +
exact MaxSim. None disables centroid interaction and sends
every probed candidate straight to decode — correct but
slower for large corpora.
centroid_score_threshold: Option<f32>Minimum per-centroid score (max dot product against any query
token) required for a centroid to contribute to candidate
generation and centroid interaction. Centroids below this
threshold are treated as unreachable for this query. None
disables pruning, matching the legacy probe behaviour.
Implementations§
Source§impl SearchParams
impl SearchParams
Sourcepub const fn paper_defaults(top_k: usize) -> Self
pub const fn paper_defaults(top_k: usize) -> Self
Defaults from Table 2 of the PLAID paper (Santhanam et al., 2022),
bucketed by requested top_k.
| top_k bucket | nprobe | t_cs | ndocs |
|---|---|---|---|
| ≤ 10 | 1 | 0.5 | 256 |
| ≤ 100 | 2 | 0.45 | 1024 |
| > 100 | 4 | 0.4 | 4096 |
The paper derives these empirically on MS MARCO and LoTTE; they
trade a small recall hit for large latency wins versus an
exhaustive probe. ndocs is always at least 4 * top_k so
Stage 3’s ndocs/4 shortlist can still return enough candidates
for the caller’s requested result count.
Trait Implementations§
Source§impl Clone for SearchParams
impl Clone for SearchParams
impl Copy for SearchParams
Auto Trait Implementations§
impl Freeze for SearchParams
impl RefUnwindSafe for SearchParams
impl Send for SearchParams
impl Sync for SearchParams
impl Unpin for SearchParams
impl UnsafeUnpin for SearchParams
impl UnwindSafe for SearchParams
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
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