pub struct SearchQuery {
pub text: Option<String>,
pub mode: SearchMode,
pub fuzzy_threshold: f32,
pub query_embedding: Option<Vec<f32>>,
pub similarity_threshold: f32,
pub entity_types: Vec<String>,
pub tags: Vec<String>,
pub tag_match_mode: TagMatchMode,
pub projects: ProjectScope,
pub pagination: Pagination,
pub include_relations: bool,
}Expand description
Search query builder
Fields§
§text: Option<String>Text to search for
mode: SearchModeSearch mode
fuzzy_threshold: f32Fuzzy search threshold (0.0-1.0, lower = more results)
query_embedding: Option<Vec<f32>>Query embedding for vector search
similarity_threshold: f32Similarity threshold for vector search (0.0-1.0, higher = stricter)
entity_types: Vec<String>Filter by entity types
Filter by tags
tag_match_mode: TagMatchModeTag matching mode
projects: ProjectScopeProject scope
pagination: PaginationPagination
include_relations: boolInclude relations in results
Implementations§
Source§impl SearchQuery
impl SearchQuery
Sourcepub fn with_mode(self, mode: SearchMode) -> Self
pub fn with_mode(self, mode: SearchMode) -> Self
Set search mode
Sourcepub fn with_fuzzy_threshold(self, threshold: f32) -> Self
pub fn with_fuzzy_threshold(self, threshold: f32) -> Self
Set fuzzy threshold
Sourcepub fn with_embedding(self, embedding: Vec<f32>) -> Self
pub fn with_embedding(self, embedding: Vec<f32>) -> Self
Set query embedding for vector search
Sourcepub fn with_similarity_threshold(self, threshold: f32) -> Self
pub fn with_similarity_threshold(self, threshold: f32) -> Self
Set similarity threshold for vector search
Sourcepub fn with_entity_type(self, entity_type: impl Into<String>) -> Self
pub fn with_entity_type(self, entity_type: impl Into<String>) -> Self
Add entity type filter
Sourcepub fn with_tag_match_mode(self, mode: TagMatchMode) -> Self
pub fn with_tag_match_mode(self, mode: TagMatchMode) -> Self
Set tag match mode
Sourcepub fn in_project(self, project_id: ProjectId) -> Self
pub fn in_project(self, project_id: ProjectId) -> Self
Search in a specific project
Sourcepub fn in_all_projects(self) -> Self
pub fn in_all_projects(self) -> Self
Search across all projects
Sourcepub fn with_pagination(self, page: usize, page_size: usize) -> Self
pub fn with_pagination(self, page: usize, page_size: usize) -> Self
Set pagination
Trait Implementations§
Source§impl Clone for SearchQuery
impl Clone for SearchQuery
Source§fn clone(&self) -> SearchQuery
fn clone(&self) -> SearchQuery
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SearchQuery
impl Debug for SearchQuery
Source§impl Default for SearchQuery
impl Default for SearchQuery
Source§fn default() -> SearchQuery
fn default() -> SearchQuery
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SearchQuery
impl<'de> Deserialize<'de> for SearchQuery
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 SearchQuery
impl RefUnwindSafe for SearchQuery
impl Send for SearchQuery
impl Sync for SearchQuery
impl Unpin for SearchQuery
impl UnsafeUnpin for SearchQuery
impl UnwindSafe for SearchQuery
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