pub struct VectorSearchQuery {
pub table: String,
pub embedding_column: String,
pub select_columns: Vec<String>,
pub distance_metric: DistanceMetric,
pub limit: u32,
pub where_clause: Option<String>,
pub order_by: Option<String>,
pub include_distance: bool,
pub offset: Option<u32>,
}Expand description
Configuration for a similarity search query.
Fields§
§table: StringTable or view to query.
embedding_column: StringColumn containing the vector embedding.
select_columns: Vec<String>Columns to select (empty = all).
distance_metric: DistanceMetricDistance metric to use.
limit: u32Maximum number of results.
where_clause: Option<String>Optional WHERE clause (without “WHERE” keyword).
order_by: Option<String>Optional additional ORDER BY clause (applied after distance ordering).
include_distance: boolWhether to include the distance score in results.
offset: Option<u32>Optional offset for pagination.
Implementations§
Source§impl VectorSearchQuery
impl VectorSearchQuery
Sourcepub fn with_embedding_column(self, column: impl Into<String>) -> Self
pub fn with_embedding_column(self, column: impl Into<String>) -> Self
Set the embedding column.
Sourcepub fn with_select_columns(self, columns: Vec<String>) -> Self
pub fn with_select_columns(self, columns: Vec<String>) -> Self
Set the columns to select.
Sourcepub fn with_distance_metric(self, metric: DistanceMetric) -> Self
pub fn with_distance_metric(self, metric: DistanceMetric) -> Self
Set the distance metric.
Sourcepub fn with_limit(self, limit: u32) -> Self
pub fn with_limit(self, limit: u32) -> Self
Set the result limit.
Sourcepub fn with_where(self, clause: impl Into<String>) -> Self
pub fn with_where(self, clause: impl Into<String>) -> Self
Set a WHERE clause filter.
Sourcepub fn with_distance_score(self) -> Self
pub fn with_distance_score(self) -> Self
Include distance score in results.
Sourcepub fn with_offset(self, offset: u32) -> Self
pub fn with_offset(self, offset: u32) -> Self
Set pagination offset.
Trait Implementations§
Source§impl Clone for VectorSearchQuery
impl Clone for VectorSearchQuery
Source§fn clone(&self) -> VectorSearchQuery
fn clone(&self) -> VectorSearchQuery
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 VectorSearchQuery
impl Debug for VectorSearchQuery
Auto Trait Implementations§
impl Freeze for VectorSearchQuery
impl RefUnwindSafe for VectorSearchQuery
impl Send for VectorSearchQuery
impl Sync for VectorSearchQuery
impl Unpin for VectorSearchQuery
impl UnsafeUnpin for VectorSearchQuery
impl UnwindSafe for VectorSearchQuery
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