pub struct SearchFilter {
pub source: Option<String>,
pub instance: Option<String>,
pub kind: Option<String>,
pub scope: Option<String>,
pub time_from: Option<i64>,
pub time_to: Option<i64>,
}Expand description
Filter pushed into the SQL candidate-retrieval stage of search_chunks_*.
All fields go into the SQL WHERE clause before LIMIT is applied,
so they shape the candidate pool itself — never just trim a pre-built
majority pool after the fact. This is the load-bearing fix from
BLUEPRINT §17.5 PR-C: with thousands of records from one adapter and a
handful from another, post-filter shrinkage can leave the minority
adapter’s results empty even when they’re the best match.
Empty filter (all fields None) is a no-op — the original
WHERE chunks_fts MATCH ? / WHERE e.model_id = ? is preserved.
Fields§
§source: Option<String>Adapter id (e.g. "claude-code", "mem0"). When set, only chunks
belonging to records from this adapter survive.
instance: Option<String>Instance discriminator. Only meaningful when source is also set
(the SQL key is (adapter, instance)).
kind: Option<String>Kind string: "fact" / "preference" / "feedback" / "reference"
/ "episode" / "skill" / "unknown".
scope: Option<String>Scope string: "user" / "project" / "session" / "ephemeral".
time_from: Option<i64>Inclusive lower bound on records.created_at (unix epoch seconds).
time_to: Option<i64>Inclusive upper bound on records.created_at (unix epoch seconds).
Implementations§
Trait Implementations§
Source§impl Clone for SearchFilter
impl Clone for SearchFilter
Source§fn clone(&self) -> SearchFilter
fn clone(&self) -> SearchFilter
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SearchFilter
impl Debug for SearchFilter
Source§impl Default for SearchFilter
impl Default for SearchFilter
Source§fn default() -> SearchFilter
fn default() -> SearchFilter
Source§impl PartialEq for SearchFilter
impl PartialEq for SearchFilter
Source§fn eq(&self, other: &SearchFilter) -> bool
fn eq(&self, other: &SearchFilter) -> bool
self and other values to be equal, and is used by ==.impl Eq for SearchFilter
impl StructuralPartialEq for SearchFilter
Auto Trait Implementations§
impl Freeze for SearchFilter
impl RefUnwindSafe for SearchFilter
impl Send for SearchFilter
impl Sync for SearchFilter
impl Unpin for SearchFilter
impl UnsafeUnpin for SearchFilter
impl UnwindSafe for SearchFilter
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.