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§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