pub struct SearchFilter {
pub domains: Option<Vec<String>>,
pub experience_types: Option<Vec<ExperienceType>>,
pub min_importance: Option<f32>,
pub min_confidence: Option<f32>,
pub since: Option<Timestamp>,
pub exclude_archived: bool,
}Expand description
Filter criteria for experience search operations.
Used by get_recent_experiences_filtered() and search_similar_filtered().
Fields set to None are not filtered on. The exclude_archived field
defaults to true since archived experiences are rarely wanted in queries.
§Example
use pulsedb::SearchFilter;
// Filter to only "Solution" experiences with importance >= 0.5
let filter = SearchFilter {
min_importance: Some(0.5),
experience_types: Some(vec![pulsedb::ExperienceType::Solution {
problem_ref: None,
approach: String::new(),
worked: true,
}]),
..SearchFilter::default()
};Fields§
§domains: Option<Vec<String>>Only include experiences with at least one matching domain tag.
None means no domain filtering. An empty Some(vec![]) matches nothing.
experience_types: Option<Vec<ExperienceType>>Only include experiences of these types.
Matching is done on the type discriminant (tag), not the associated data.
For example, any Solution { .. } matches if Solution is in the list.
min_importance: Option<f32>Only include experiences with importance >= this threshold.
min_confidence: Option<f32>Only include experiences with confidence >= this threshold.
since: Option<Timestamp>Only include experiences created at or after this timestamp.
exclude_archived: boolWhether to exclude archived experiences (default: true).
Implementations§
Source§impl SearchFilter
impl SearchFilter
Sourcepub fn matches(&self, experience: &Experience) -> bool
pub fn matches(&self, experience: &Experience) -> bool
Returns true if the given experience passes all filter criteria.
Trait Implementations§
Source§impl Clone for SearchFilter
impl Clone for SearchFilter
Source§fn clone(&self) -> SearchFilter
fn clone(&self) -> SearchFilter
1.0.0 · 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
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<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