pub struct HybridSearchResponse {Show 17 fields
pub query: String,
pub k: usize,
pub rrf_k: u32,
pub weights: Weights,
pub results: Vec<HybridSearchItem>,
pub graph_matches: Vec<RecallItem>,
pub max_graph_results: Option<usize>,
pub fts_degraded: bool,
pub fts_error: Option<String>,
pub fts_auto_rebuilt: bool,
pub vec_degraded: bool,
pub vec_error: Option<String>,
pub warning: Option<String>,
pub backend_invoked: Option<&'static str>,
pub vec_degraded_reason: Option<String>,
pub vec_degraded_code: Option<&'static str>,
pub elapsed_ms: u64,
}Expand description
Hybrid search response.
Fields§
§query: StringSearch query text.
k: usizeMaximum number of results to return.
rrf_k: u32RRF k parameter used in the combined ranking.
weights: WeightsWeights applied to vec and fts sources in the RRF fusion.
results: Vec<HybridSearchItem>Results.
graph_matches: Vec<RecallItem>Graph matches.
max_graph_results: Option<usize>Ceiling applied to graph_matches; null when the cap is disabled.
Echoed because the cap is ACTIVE by default
(crate::constants::DEFAULT_HYBRID_MAX_GRAPH_RESULTS): a truncation the
caller cannot see is worse than no truncation, since a short
graph_matches would otherwise be indistinguishable from a small
neighbourhood.
fts_degraded: boolTrue when FTS5 failed and the response is vec-only.
Omitted from JSON when false to keep the happy-path envelope clean.
fts_error: Option<String>Human-readable description of the FTS5 failure when fts_degraded is true.
Omitted from JSON when None.
fts_auto_rebuilt: boolTrue when the FTS5 index was corrupted and successfully auto-rebuilt during this request.
Omitted from JSON when false to keep the happy-path envelope clean.
vec_degraded: boolG58 (v1.0.80): symmetric to fts_degraded; true when the live query
embedding failed and the response degraded to FTS5-only. Absent on the
wire when false.
vec_error: Option<String>G58 (v1.0.80): human-readable description of the embedding failure
that triggered the fallback. Absent on the wire when vec_degraded is
false.
warning: Option<String>G58 (v1.0.80): advisory warning echoed for callers that branch on top-level status. Distinguishes a FTS5-only fallback from a clean hybrid response so downstream pipelines can lower their confidence.
backend_invoked: Option<&'static str>v1.0.84 (ADR-0042): discriminator of the embedding backend that actually
ran the live embedding. "openrouter" | "none". Absent
on the wire when None (kept for happy-path envelope cleanliness).
vec_degraded_reason: Option<String>Operator-facing PROSE for the degradation, not a closed set.
What lands here is FallbackReason’s Display, carrying the provider’s
own message, so no enum could ever have held it. GAP-SG-290 measured
this; the machine-readable half travels beside it in
Self::vec_degraded_code rather than replacing this field.
vec_degraded_code: Option<&'static str>v1.2.8 (GAP-SG-290): stable, machine-readable code for the degradation.
FallbackReason::reason_code() plus FALLBACK_FTS_ONLY_CODE, which is
the eight-value set a consumer can match on. Absent when vec_degraded
is false, so the happy-path envelope is byte-identical.
elapsed_ms: u64Total execution time in milliseconds from handler start to serialisation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HybridSearchResponse
impl RefUnwindSafe for HybridSearchResponse
impl Send for HybridSearchResponse
impl Sync for HybridSearchResponse
impl Unpin for HybridSearchResponse
impl UnsafeUnpin for HybridSearchResponse
impl UnwindSafe for HybridSearchResponse
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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