pub struct HybridRetrieverConfig {
pub vector_weight: f64,
pub bm25_weight: f64,
pub rrf_k: f64,
pub use_rrf: bool,
pub candidate_multiplier: usize,
pub min_score_threshold: f64,
}Expand description
混合检索配置
Fields§
§vector_weight: f64向量检索权重
bm25_weight: f64BM25 检索权重
rrf_k: f64RRF 参数 K
use_rrf: bool是否启用 RRF 融合
candidate_multiplier: usize候选结果扩展倍数
min_score_threshold: f64最小分数阈值
Implementations§
Source§impl HybridRetrieverConfig
impl HybridRetrieverConfig
Sourcepub fn vector_only() -> Self
pub fn vector_only() -> Self
创建仅向量检索配置
Sourcepub fn with_weights(self, vector: f64, bm25: f64) -> Self
pub fn with_weights(self, vector: f64, bm25: f64) -> Self
设置权重
Sourcepub fn with_candidate_multiplier(self, multiplier: usize) -> Self
pub fn with_candidate_multiplier(self, multiplier: usize) -> Self
设置候选扩展倍数
Sourcepub fn with_min_score(self, threshold: f64) -> Self
pub fn with_min_score(self, threshold: f64) -> Self
设置最小分数阈值
Sourcepub fn normalize_weights(&mut self)
pub fn normalize_weights(&mut self)
归一化权重
Trait Implementations§
Source§impl Clone for HybridRetrieverConfig
impl Clone for HybridRetrieverConfig
Source§fn clone(&self) -> HybridRetrieverConfig
fn clone(&self) -> HybridRetrieverConfig
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 moreSource§impl Debug for HybridRetrieverConfig
impl Debug for HybridRetrieverConfig
Auto Trait Implementations§
impl Freeze for HybridRetrieverConfig
impl RefUnwindSafe for HybridRetrieverConfig
impl Send for HybridRetrieverConfig
impl Sync for HybridRetrieverConfig
impl Unpin for HybridRetrieverConfig
impl UnsafeUnpin for HybridRetrieverConfig
impl UnwindSafe for HybridRetrieverConfig
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