pub struct Keyword {
pub index: String,
pub k: usize,
}Expand description
Keyword (BM25) retrieval operator.
Fields§
§index: String§k: usizeImplementations§
Source§impl Keyword
impl Keyword
Sourcepub fn bm25(index: impl Into<String>, k: usize) -> Keyword
pub fn bm25(index: impl Into<String>, k: usize) -> Keyword
Build a new BM25 operator. k is clamped to super::MAX_K.
pub fn and<R>(self, other: R) -> AndRetrieverwhere
R: Retriever + 'static,
pub fn or<R>(self, other: R) -> OrRetrieverwhere
R: Retriever + 'static,
pub fn then<R>(self, other: R) -> ThenRetrieverwhere
R: Retriever + 'static,
pub fn top(self, n: usize) -> TopRetriever
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 keyword path errors, switch to
fallback and tag returned hits with degraded: true (Plan 02-03).
Trait Implementations§
Source§impl Retriever for Keyword
impl Retriever for Keyword
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,
Keyword: '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,
Keyword: '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 Keyword
impl RefUnwindSafe for Keyword
impl Send for Keyword
impl Sync for Keyword
impl Unpin for Keyword
impl UnsafeUnpin for Keyword
impl UnwindSafe for Keyword
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