pub struct VectorIndexManager { /* private fields */ }Expand description
Manager for all vector indices in the system
Implementations§
Source§impl VectorIndexManager
impl VectorIndexManager
Sourcepub fn new() -> VectorIndexManager
pub fn new() -> VectorIndexManager
Create a new manager
Sourcepub fn create_index(
&self,
label: &str,
property_key: &str,
dimensions: usize,
metric: DistanceMetric,
) -> Result<(), VectorError>
pub fn create_index( &self, label: &str, property_key: &str, dimensions: usize, metric: DistanceMetric, ) -> Result<(), VectorError>
Create a new index
Sourcepub fn get_index(
&self,
label: &str,
property_key: &str,
) -> Option<Arc<RwLock<VectorIndex>>>
pub fn get_index( &self, label: &str, property_key: &str, ) -> Option<Arc<RwLock<VectorIndex>>>
Get an index
Sourcepub fn add_vector(
&self,
label: &str,
property_key: &str,
node_id: NodeId,
vector: &Vec<f32>,
) -> Result<(), VectorError>
pub fn add_vector( &self, label: &str, property_key: &str, node_id: NodeId, vector: &Vec<f32>, ) -> Result<(), VectorError>
Add a vector to an index
Sourcepub fn search(
&self,
label: &str,
property_key: &str,
query: &[f32],
k: usize,
) -> Result<Vec<(NodeId, f32)>, VectorError>
pub fn search( &self, label: &str, property_key: &str, query: &[f32], k: usize, ) -> Result<Vec<(NodeId, f32)>, VectorError>
Search an index
Sourcepub fn list_indices(&self) -> Vec<IndexKey>
pub fn list_indices(&self) -> Vec<IndexKey>
List all indices
Trait Implementations§
Source§impl Debug for VectorIndexManager
impl Debug for VectorIndexManager
Source§impl Default for VectorIndexManager
impl Default for VectorIndexManager
Source§fn default() -> VectorIndexManager
fn default() -> VectorIndexManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for VectorIndexManager
impl RefUnwindSafe for VectorIndexManager
impl Send for VectorIndexManager
impl Sync for VectorIndexManager
impl Unpin for VectorIndexManager
impl UnsafeUnpin for VectorIndexManager
impl UnwindSafe for VectorIndexManager
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> 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> 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 more