pub struct Vector {
pub index: String,
pub k: usize,
}Expand description
Vector retrieval operator.
Construction is fluent — you wire it up at recall()-build time, the
network call only happens at .execute() time.
Fields§
§index: String§k: usizeImplementations§
Source§impl Vector
impl Vector
Sourcepub fn new(index: impl Into<String>, k: usize) -> Vector
pub fn new(index: impl Into<String>, k: usize) -> Vector
Build a new Vector operator targeting the given backend index
(e.g., "chunks") with k candidates.
k is clamped to super::MAX_K (T-02-02-03 DoS mitigation).
Sourcepub fn and<R>(self, other: R) -> AndRetrieverwhere
R: Retriever + 'static,
pub fn and<R>(self, other: R) -> AndRetrieverwhere
R: Retriever + 'static,
Convenience: wrap into the standard combinator builder. Implemented in
combinators to avoid trait-method orphan rules with the generic
.and / .or / .then.
pub fn or<R>(self, other: R) -> OrRetrieverwhere
R: Retriever + 'static,
pub fn then<R>(self, other: R) -> ThenRetrieverwhere
R: Retriever + 'static,
Sourcepub fn top(self, n: usize) -> TopRetriever
pub fn top(self, n: usize) -> TopRetriever
Cap the final result set after the operator tree resolves.
Sourcepub fn rerank(self, reranker: Arc<dyn Reranker>) -> RerankRetriever
pub fn rerank(self, reranker: Arc<dyn Reranker>) -> RerankRetriever
Wrap with a cross-encoder rerank pass (Plan 02-03).
Sourcepub fn degraded_fallback<R>(self, fallback: R) -> DegradedFallbackRetrieverwhere
R: Retriever + 'static,
pub fn degraded_fallback<R>(self, fallback: R) -> DegradedFallbackRetrieverwhere
R: Retriever + 'static,
Wrap with a fallback retriever — if THIS vector path errors, switch to
fallback and tag returned hits with degraded: true (Plan 02-03).
Trait Implementations§
Source§impl Retriever for Vector
impl Retriever for Vector
Source§fn retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 QueryContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<RawHit>, LunarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Vector: 'async_trait,
fn retrieve<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 QueryContext,
) -> Pin<Box<dyn Future<Output = Result<Vec<RawHit>, LunarisError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Vector: 'async_trait,
Run the operator against
ctx and return the unranked-or-ranked
raw hits this operator produces. The downstream stage (combinator
or fuse_rrf) decides what to do with them.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Cast this operator to
&dyn Any so the RRF routing dispatcher can
recover the concrete operator type. Concrete operators override with
fn as_any(&self) -> &dyn Any { self }. The default returns a sentinel
&() so unknown operators downcast as None (and the dispatcher falls
back to client-side RRF instead of misrouting).Auto Trait Implementations§
impl Freeze for Vector
impl RefUnwindSafe for Vector
impl Send for Vector
impl Sync for Vector
impl Unpin for Vector
impl UnsafeUnpin for Vector
impl UnwindSafe for Vector
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
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> ⓘ
Converts
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> ⓘ
Converts
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