pub enum RrfFusion {
Client {
k: usize,
},
Moon {
k: usize,
weights: [f64; 2],
},
}Expand description
RRF (Reciprocal Rank Fusion) mode for the retrieval DSL.
Phase 2’s fuse_rrf operator chooses between client-side fusion and
Moon-native text().hybrid_search() based on this hint and the backend’s
StorageCapabilities::native_rrf
flag. Phase 1.5 (STORE-09) ships the type + the capability bit; Phase 2
wires the operator that consumes them.
§Example
use lunaris_core::RrfFusion;
// Always available: the fold happens in-process, so it needs no
// backend capability at all.
let client_side = RrfFusion::Client { k: 60 };
// Only valid when capabilities().native_rrf == true (Moon backend) AND
// both branches are Vector + Keyword(BM25) on the same Moon index.
let moon_native = RrfFusion::Moon { k: 60, weights: [0.5, 0.5] };
match moon_native {
RrfFusion::Moon { k, weights } => {
assert_eq!(k, 60);
assert_eq!(weights, [0.5, 0.5]);
}
_ => unreachable!(),
}Variants§
Client
Client-side fusion: collect both branches’ results, apply 1 / (k + rank)
per branch, sum scores. Works on any StoragePort
backend regardless of capabilities().native_rrf.
Moon
Moon-native fusion: invoke
FT.SEARCH ... HYBRID VECTOR ... SPARSE ... FUSION RRF WEIGHTS <bm25_w> <vec_w>
in a single round trip via client.text().hybrid_search(). Only valid when
capabilities().native_rrf == true AND both branches are Vector and
Keyword(BM25) operators on the same Moon index. Phase 2’s fuse_rrf
query planner picks this variant when both hold; anything else — a
Graph branch in the tree, or legs on different indices — folds
Client-side.
Trait Implementations§
impl Copy for RrfFusion
impl StructuralPartialEq for RrfFusion
Auto Trait Implementations§
impl Freeze for RrfFusion
impl RefUnwindSafe for RrfFusion
impl Send for RrfFusion
impl Sync for RrfFusion
impl Unpin for RrfFusion
impl UnsafeUnpin for RrfFusion
impl UnwindSafe for RrfFusion
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
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> ⓘ
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