pub struct VectorSearchResult {
pub id: u64,
pub collection: String,
pub distance: f32,
pub vector: Option<Vec<f32>>,
pub metadata: Option<HashMap<String, Value>>,
pub linked_node: Option<String>,
pub linked_row: Option<(String, u64)>,
}Expand description
A vector search result
Fields§
§id: u64Vector ID
collection: StringCollection name
distance: f32Distance to query vector
vector: Option<Vec<f32>>The vector data (if requested)
metadata: Option<HashMap<String, Value>>Metadata (if requested)
linked_node: Option<String>Linked node ID (if cross-referenced)
linked_row: Option<(String, u64)>Linked table row (table, row_id)
Implementations§
Source§impl VectorSearchResult
impl VectorSearchResult
Sourcepub fn new(id: u64, collection: impl Into<String>, distance: f32) -> Self
pub fn new(id: u64, collection: impl Into<String>, distance: f32) -> Self
Create a new vector search result
Sourcepub fn with_vector(self, vector: Vec<f32>) -> Self
pub fn with_vector(self, vector: Vec<f32>) -> Self
Include vector data
Sourcepub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
pub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
Include metadata
Sourcepub fn with_linked_node(self, node_id: impl Into<String>) -> Self
pub fn with_linked_node(self, node_id: impl Into<String>) -> Self
Link to a graph node
Sourcepub fn with_linked_row(self, table: impl Into<String>, row_id: u64) -> Self
pub fn with_linked_row(self, table: impl Into<String>, row_id: u64) -> Self
Link to a table row
Trait Implementations§
Source§impl Clone for VectorSearchResult
impl Clone for VectorSearchResult
Source§fn clone(&self) -> VectorSearchResult
fn clone(&self) -> VectorSearchResult
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 VectorSearchResult
impl Debug for VectorSearchResult
Auto Trait Implementations§
impl Freeze for VectorSearchResult
impl RefUnwindSafe for VectorSearchResult
impl Send for VectorSearchResult
impl Sync for VectorSearchResult
impl Unpin for VectorSearchResult
impl UnsafeUnpin for VectorSearchResult
impl UnwindSafe for VectorSearchResult
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