pub struct ExactVectorIndex { /* private fields */ }Expand description
The native, in-process VectorIndex: exact (brute-force) cosine
ranking over an in-memory map — the true top-k, ties broken by id
ascending, so the same corpus and query always answer in the same
order. For development, tests, and small single-process corpora:
data is not persisted, and a restart starts empty.
Implementations§
Trait Implementations§
Source§impl VectorIndex for ExactVectorIndex
impl VectorIndex for ExactVectorIndex
Source§fn upsert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 VectorNamespace,
records: &'life2 [VectorRecord],
) -> Pin<Box<dyn Future<Output = Result<(), VectorIndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn upsert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 VectorNamespace,
records: &'life2 [VectorRecord],
) -> Pin<Box<dyn Future<Output = Result<(), VectorIndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Writes every record into
namespace, replacing any existing record
with the same id — values and metadata both, never a merge. Read moreSource§fn query<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 VectorNamespace,
vector: &'life2 [f32],
k: usize,
filter: &'life3 VectorFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorMatch>, VectorIndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn query<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
namespace: &'life1 VectorNamespace,
vector: &'life2 [f32],
k: usize,
filter: &'life3 VectorFilter,
) -> Pin<Box<dyn Future<Output = Result<Vec<VectorMatch>, VectorIndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
The at-most-
k nearest neighbours of vector in namespace,
cosine similarity descending, every match satisfying filter. Read moreSource§fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 VectorNamespace,
ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<(), VectorIndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
namespace: &'life1 VectorNamespace,
ids: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<(), VectorIndexError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Removes the records named by
ids from namespace. A missing id is
not an error: the delete is idempotent. Read moreAuto Trait Implementations§
impl !Freeze for ExactVectorIndex
impl RefUnwindSafe for ExactVectorIndex
impl Send for ExactVectorIndex
impl Sync for ExactVectorIndex
impl Unpin for ExactVectorIndex
impl UnsafeUnpin for ExactVectorIndex
impl UnwindSafe for ExactVectorIndex
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