pub struct SearchOptions {
pub limit: usize,
pub min_similarity: f32,
pub category: Option<String>,
pub tags: Vec<String>,
pub use_learning: bool,
pub include_related: bool,
pub diversity: f32,
pub hybrid: bool,
pub keyword_weight: f32,
}Expand description
Options for configuring search behavior.
Fields§
§limit: usizeMaximum number of results to return.
min_similarity: f32Minimum similarity threshold (0.0 to 1.0).
category: Option<String>Filter by category.
Filter by tags (any match).
use_learning: boolApply learned relevance boosting.
Include related entries in results.
diversity: f32Diversity factor for MMR (Maximal Marginal Relevance).
hybrid: boolUse hybrid search (combine vector + keyword).
keyword_weight: f32Keyword weight for hybrid search (0.0 to 1.0).
Implementations§
Source§impl SearchOptions
impl SearchOptions
Sourcepub fn with_min_similarity(self, threshold: f32) -> Self
pub fn with_min_similarity(self, threshold: f32) -> Self
Set minimum similarity threshold.
Sourcepub fn with_category(self, category: impl Into<String>) -> Self
pub fn with_category(self, category: impl Into<String>) -> Self
Filter by category.
Filter by tags.
Sourcepub fn without_learning(self) -> Self
pub fn without_learning(self) -> Self
Disable learning-based relevance boosting.
Include related entries.
Sourcepub fn with_diversity(self, factor: f32) -> Self
pub fn with_diversity(self, factor: f32) -> Self
Set diversity factor for MMR.
Trait Implementations§
Source§impl Clone for SearchOptions
impl Clone for SearchOptions
Source§fn clone(&self) -> SearchOptions
fn clone(&self) -> SearchOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SearchOptions
impl Debug for SearchOptions
Source§impl Default for SearchOptions
impl Default for SearchOptions
Source§impl<'de> Deserialize<'de> for SearchOptions
impl<'de> Deserialize<'de> for SearchOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SearchOptions
impl RefUnwindSafe for SearchOptions
impl Send for SearchOptions
impl Sync for SearchOptions
impl Unpin for SearchOptions
impl UnsafeUnpin for SearchOptions
impl UnwindSafe for SearchOptions
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
Mutably borrows from an owned value. Read more
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request