pub struct EmbeddingVectorIndex<V, P>where
V: VectorIndex,
P: EmbeddingProvider,{ /* private fields */ }Expand description
Vector index with automatic text embedding
Implementations§
Source§impl<V, P> EmbeddingVectorIndex<V, P>where
V: VectorIndex,
P: EmbeddingProvider,
impl<V, P> EmbeddingVectorIndex<V, P>where
V: VectorIndex,
P: EmbeddingProvider,
Sourcepub fn new(index: Arc<V>, provider: Arc<P>) -> Self
pub fn new(index: Arc<V>, provider: Arc<P>) -> Self
Create a new embedding-enabled vector index
Sourcepub fn search_text(
&self,
collection: &str,
text: &str,
k: usize,
min_score: Option<f32>,
) -> Result<Vec<VectorSearchResult>, String>
pub fn search_text( &self, collection: &str, text: &str, k: usize, min_score: Option<f32>, ) -> Result<Vec<VectorSearchResult>, String>
Search by text (automatically generates embedding)
Trait Implementations§
Source§impl<V, P> VectorIndex for EmbeddingVectorIndex<V, P>where
V: VectorIndex,
P: EmbeddingProvider,
impl<V, P> VectorIndex for EmbeddingVectorIndex<V, P>where
V: VectorIndex,
P: EmbeddingProvider,
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<V, P> Freeze for EmbeddingVectorIndex<V, P>
impl<V, P> RefUnwindSafe for EmbeddingVectorIndex<V, P>where
V: RefUnwindSafe,
P: RefUnwindSafe,
impl<V, P> Send for EmbeddingVectorIndex<V, P>
impl<V, P> Sync for EmbeddingVectorIndex<V, P>
impl<V, P> Unpin for EmbeddingVectorIndex<V, P>
impl<V, P> UnwindSafe for EmbeddingVectorIndex<V, P>where
V: RefUnwindSafe,
P: RefUnwindSafe,
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