pub struct QueryRequest {
pub vector: Vec<f32>,
pub top_k: u32,
pub distance_metric: DistanceMetric,
pub filter: Option<Value>,
pub include_metadata: bool,
pub include_vectors: bool,
pub consistency: ReadConsistency,
pub staleness_config: Option<StalenessConfig>,
}Expand description
Query request for vector similarity search
Fields§
§vector: Vec<f32>Query vector
top_k: u32Number of results to return
distance_metric: DistanceMetricDistance metric to use
filter: Option<Value>Optional filter expression
include_metadata: boolWhether to include metadata in results
include_vectors: boolWhether to include vector values in results
consistency: ReadConsistencyRead consistency level
staleness_config: Option<StalenessConfig>Staleness configuration for bounded staleness reads
Implementations§
Source§impl QueryRequest
impl QueryRequest
Sourcepub fn with_filter(self, filter: Value) -> Self
pub fn with_filter(self, filter: Value) -> Self
Add a filter to the query
Sourcepub fn include_metadata(self, include: bool) -> Self
pub fn include_metadata(self, include: bool) -> Self
Set whether to include metadata
Sourcepub fn include_vectors(self, include: bool) -> Self
pub fn include_vectors(self, include: bool) -> Self
Set whether to include vector values
Sourcepub fn with_distance_metric(self, metric: DistanceMetric) -> Self
pub fn with_distance_metric(self, metric: DistanceMetric) -> Self
Set distance metric
Sourcepub fn with_consistency(self, consistency: ReadConsistency) -> Self
pub fn with_consistency(self, consistency: ReadConsistency) -> Self
Set read consistency level
Sourcepub fn with_bounded_staleness(self, max_staleness_ms: u64) -> Self
pub fn with_bounded_staleness(self, max_staleness_ms: u64) -> Self
Set bounded staleness with max staleness in ms
Sourcepub fn with_strong_consistency(self) -> Self
pub fn with_strong_consistency(self) -> Self
Use strong consistency (always read from primary)
Trait Implementations§
Source§impl Clone for QueryRequest
impl Clone for QueryRequest
Source§fn clone(&self) -> QueryRequest
fn clone(&self) -> QueryRequest
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 QueryRequest
impl Debug for QueryRequest
Source§impl<'de> Deserialize<'de> for QueryRequest
impl<'de> Deserialize<'de> for QueryRequest
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 QueryRequest
impl RefUnwindSafe for QueryRequest
impl Send for QueryRequest
impl Sync for QueryRequest
impl Unpin for QueryRequest
impl UnsafeUnpin for QueryRequest
impl UnwindSafe for QueryRequest
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