Skip to main content

uqa_core/
retrieval.rs

1//
2// Unified Query Algebra
3//
4// Copyright (c) 2023-2026 Cognica, Inc.
5//
6
7//! Runtime-independent retrieval configuration shared by logical and physical plans.
8
9#[derive(Clone, Debug)]
10pub enum GatingSpec {
11    /// Lucene-compatible softplus gating.
12    Softplus,
13    /// Raw signal score scales the fused logit.
14    Pass,
15    /// Sigmoid gating with the named feature.
16    Sigmoid { feature: String },
17    /// `ReLU` gate.
18    ReLU,
19    /// Swish gate.
20    Swish,
21    /// GELU gate.
22    Gelu,
23}
24
25#[derive(Clone, Copy, Debug, PartialEq, Eq)]
26pub enum ExternalPriorMode {
27    Authority,
28    Recency,
29}
30
31#[derive(Clone, Copy, Debug, PartialEq)]
32pub enum MultiStageCutoff {
33    /// Top-K results -- final cardinality is `k`.
34    TopK(usize),
35    /// Fractional cutoff -- final cardinality is `n * ratio`.
36    Ratio(f64),
37}
38
39#[derive(Clone, Debug, Default)]
40pub struct TemporalFilterIR {
41    pub timestamp: Option<f64>,
42    pub time_range: Option<(f64, f64)>,
43}
44
45#[derive(Debug, Clone, Copy, PartialEq, Eq)]
46pub enum Direction {
47    Out,
48    In,
49    Both,
50}