pub struct RetrievalConfig {
pub hybrid_alpha: f64,
pub candidate_k_keyword: i64,
pub candidate_k_vector: i64,
pub final_limit: i64,
pub group_by: String,
pub doc_agg: String,
pub max_chunks_per_doc: usize,
}Expand description
Search and retrieval tuning parameters.
These settings control how keyword and semantic search results are merged in hybrid mode, and the overall result limits.
§Hybrid Scoring
The hybrid_alpha weight determines the blend between keyword (BM25)
and semantic (cosine similarity) scores:
hybrid_score = (1 - α) × keyword_score + α × semantic_scoreα = 0.0→ pure keyword searchα = 1.0→ pure semantic searchα = 0.6(default) → 60% semantic, 40% keyword
See docs/HYBRID_SCORING.md for the full specification.
Fields§
§hybrid_alpha: f64Weight for semantic vs. keyword scores in hybrid mode.
Range: [0.0, 1.0]. Default: 0.6.
candidate_k_keyword: i64Number of keyword candidates to fetch before merging. Default: 80.
candidate_k_vector: i64Number of vector candidates to fetch before merging. Default: 80.
final_limit: i64Maximum number of results to return after merging and ranking. Default: 12.
group_by: StringGrouping strategy for results. Default: "document".
doc_agg: StringAggregation method for document-level scores. Default: "max".
max_chunks_per_doc: usizeMaximum chunks per document in results. Default: 3.
Trait Implementations§
Source§impl Clone for RetrievalConfig
impl Clone for RetrievalConfig
Source§fn clone(&self) -> RetrievalConfig
fn clone(&self) -> RetrievalConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RetrievalConfig
impl Debug for RetrievalConfig
Source§impl<'de> Deserialize<'de> for RetrievalConfig
impl<'de> Deserialize<'de> for RetrievalConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RetrievalConfig
impl RefUnwindSafe for RetrievalConfig
impl Send for RetrievalConfig
impl Sync for RetrievalConfig
impl Unpin for RetrievalConfig
impl UnsafeUnpin for RetrievalConfig
impl UnwindSafe for RetrievalConfig
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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