pub struct VectorQuery {
pub alias: Option<String>,
pub collection: String,
pub query_vector: VectorSource,
pub k: usize,
pub filter: Option<MetadataFilter>,
pub metric: Option<DistanceMetric>,
pub include_vectors: bool,
pub include_metadata: bool,
pub threshold: Option<f32>,
}Expand description
Vector similarity search query
VECTOR SEARCH embeddings
SIMILAR TO [0.1, 0.2, ..., 0.5]
WHERE metadata.source = 'nmap'
LIMIT 10Fields§
§alias: Option<String>Optional outer alias when used as a join source
collection: StringCollection name to search
query_vector: VectorSourceQuery vector (or reference to get vector from)
k: usizeNumber of results to return
filter: Option<MetadataFilter>Metadata filter
metric: Option<DistanceMetric>Distance metric to use (defaults to collection’s metric)
include_vectors: boolInclude vectors in results
include_metadata: boolInclude metadata in results
threshold: Option<f32>Minimum similarity threshold (optional)
Implementations§
Source§impl VectorQuery
impl VectorQuery
Sourcepub fn new(collection: &str, query: VectorSource) -> VectorQuery
pub fn new(collection: &str, query: VectorSource) -> VectorQuery
Create a new vector query
Sourcepub fn limit(self, k: usize) -> VectorQuery
pub fn limit(self, k: usize) -> VectorQuery
Set the number of results
Sourcepub fn with_filter(self, filter: MetadataFilter) -> VectorQuery
pub fn with_filter(self, filter: MetadataFilter) -> VectorQuery
Set metadata filter
Sourcepub fn with_vectors(self) -> VectorQuery
pub fn with_vectors(self) -> VectorQuery
Include vectors in results
Sourcepub fn min_similarity(self, threshold: f32) -> VectorQuery
pub fn min_similarity(self, threshold: f32) -> VectorQuery
Set similarity threshold
Sourcepub fn alias(self, alias: &str) -> VectorQuery
pub fn alias(self, alias: &str) -> VectorQuery
Set outer alias
Trait Implementations§
Source§impl Clone for VectorQuery
impl Clone for VectorQuery
Source§fn clone(&self) -> VectorQuery
fn clone(&self) -> VectorQuery
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 moreAuto Trait Implementations§
impl Freeze for VectorQuery
impl RefUnwindSafe for VectorQuery
impl Send for VectorQuery
impl Sync for VectorQuery
impl Unpin for VectorQuery
impl UnsafeUnpin for VectorQuery
impl UnwindSafe for VectorQuery
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> 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>
Converts
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>
Converts
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 moreSource§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