pub struct SimpleVectorIndex { /* private fields */ }Expand description
In-memory vector index for CONTEXT SELECT SEARCH
This provides a simple implementation that can be used directly or wrapped around the sochdb-index HNSW implementation.
Implementations§
Source§impl SimpleVectorIndex
impl SimpleVectorIndex
Sourcepub fn create_collection(&self, name: &str, dimension: usize)
pub fn create_collection(&self, name: &str, dimension: usize)
Create or get a collection
Trait Implementations§
Source§impl Default for SimpleVectorIndex
impl Default for SimpleVectorIndex
Source§impl VectorIndex for SimpleVectorIndex
impl VectorIndex for SimpleVectorIndex
Source§fn search_by_embedding(
&self,
collection: &str,
embedding: &[f32],
k: usize,
min_score: Option<f32>,
) -> Result<Vec<VectorSearchResult>, String>
fn search_by_embedding( &self, collection: &str, embedding: &[f32], k: usize, min_score: Option<f32>, ) -> Result<Vec<VectorSearchResult>, String>
Search for k nearest neighbors to the query vector
Auto Trait Implementations§
impl !Freeze for SimpleVectorIndex
impl RefUnwindSafe for SimpleVectorIndex
impl Send for SimpleVectorIndex
impl Sync for SimpleVectorIndex
impl Unpin for SimpleVectorIndex
impl UnsafeUnpin for SimpleVectorIndex
impl UnwindSafe for SimpleVectorIndex
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> 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