Skip to main content

SearchConfig

Struct SearchConfig 

Source
pub struct SearchConfig {
Show 26 fields pub bm25_weight: f64, pub vector_weight: f64, pub sparse_weight: f64, pub sparse_top_k: usize, pub sparse_min_score: f64, pub derive_sparse_from_dense: bool, pub sparse_derive_top_k: usize, pub sparse_derive_min_weight: f32, pub late_interaction_weight: f64, pub bm25_k1: f64, pub bm25_b: f64, pub namespace_weights: HashMap<String, f64>, pub rrf_k: f64, pub candidate_pool_size: usize, pub default_top_k: usize, pub min_similarity: f64, pub recency_half_life_days: Option<f64>, pub recency_weight: f64, pub rerank_from_f32: bool, pub derived_vector_backend: DerivedVectorBackendPolicy, pub turbo_quant_bits: u8, pub turbo_quant_projections: usize, pub turbo_quant_seed: u64, pub turbo_quant_require_exact_rerank: bool, pub candidate_dims: Option<usize>, pub compress_results: bool,
}
Expand description

Search tuning parameters.

Fields§

§bm25_weight: f64

Weight for BM25 score in RRF fusion.

§vector_weight: f64

Weight for vector similarity in RRF fusion.

§sparse_weight: f64

Weight for sparse dot-product ranking in RRF fusion. Defaults to 0.0 so existing BM25+dense behavior is unchanged.

§sparse_top_k: usize

Maximum sparse candidates admitted to fusion.

§sparse_min_score: f64

Minimum sparse dot-product score admitted to fusion.

§derive_sparse_from_dense: bool

Explicitly allow dense-only embedders to derive generic sparse weights. This is disabled by default and the result must not be described as SPLADE.

§sparse_derive_top_k: usize

Maximum dense dimensions retained by explicit generic sparse derivation.

§sparse_derive_min_weight: f32

Minimum absolute dense value retained by generic sparse derivation.

§late_interaction_weight: f64

Weight for late interaction (ColBERT MaxSim) in RRF fusion. Defaults to 0.0 (disabled). Set to 1.0 to enable as 3rd RRF signal.

§bm25_k1: f64

BM25 k1 parameter. Controls term frequency saturation. Default: 1.2 (FTS5 standard). Lower (0.8-1.0) helps with technical content.

§bm25_b: f64

BM25 b parameter. Controls document length normalization. Default: 0.75 (FTS5 standard).

§namespace_weights: HashMap<String, f64>

Optional per-namespace weight multipliers. Empty = no weighting (all namespaces scored equally).

§rrf_k: f64

RRF constant (k). Controls rank importance decay.

§candidate_pool_size: usize

Number of candidates from each search method before fusion.

§default_top_k: usize

Default number of results to return.

§min_similarity: f64

Minimum cosine similarity threshold for vector candidates.

§recency_half_life_days: Option<f64>

Optional recency boost. If enabled, results are boosted based on how recently they were created/updated. The value is the half-life in days — a fact that is recency_half_life_days old gets 50% of the recency boost. None = no recency weighting (current behavior, default).

§recency_weight: f64

Weight of the recency boost relative to BM25 and vector scores in RRF. Only used when recency_half_life_days is Some. Default: 0.5

§rerank_from_f32: bool

When true, rerank top HNSW candidates using exact f32 cosine similarity from SQLite. Improves recall at the cost of one batched SQL query. Only applies when HNSW feature is enabled. Default: true

§derived_vector_backend: DerivedVectorBackendPolicy

Optional derived-vector candidate backend. Disabled by default because raw f32 embeddings remain authoritative.

§turbo_quant_bits: u8

TurboQuant polar angle bits when the TurboQuant candidate backend is enabled.

§turbo_quant_projections: usize

TurboQuant QJL projection count when the TurboQuant candidate backend is enabled.

§turbo_quant_seed: u64

TurboQuant profile seed when the TurboQuant candidate backend is enabled.

§turbo_quant_require_exact_rerank: bool

Require exact f32 rerank for TurboQuant candidates. Defaults to true.

§candidate_dims: Option<usize>

Matryoshka candidate-stage embedding dimensions for 2-stage search. When set to Some(dim) and the matryoshka feature is enabled, the query embedding is truncated to dim dimensions for candidate retrieval, then reranked with the full embedding. Defaults to Some(64). Set to None to disable 2-stage matryoshka search.

§compress_results: bool

When true, compress search result content using SimpleMem-style semantic compression (first sentence + key terms, capped at 150 chars). Defaults to false.

Trait Implementations§

Source§

impl Clone for SearchConfig

Source§

fn clone(&self) -> SearchConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SearchConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SearchConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for SearchConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for SearchConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more