pub struct OpenSearchVectorStore { /* private fields */ }Expand description
A VectorStore backed by OpenSearch with the k-NN plugin.
Use OpenSearchVectorStoreBuilder to construct.
Implementations§
Source§impl OpenSearchVectorStore
impl OpenSearchVectorStore
Sourcepub fn client(&self) -> &OpenSearch
pub fn client(&self) -> &OpenSearch
Returns a reference to the underlying OpenSearch client.
Sourcepub fn dimensions(&self) -> usize
pub fn dimensions(&self) -> usize
Returns the configured vector dimensions.
Sourcepub fn space_type(&self) -> SpaceType
pub fn space_type(&self) -> SpaceType
Returns the configured k-NN space type (distance metric).
This determines how OpenSearch scores query hits; see query
for why those scores are only comparable within a single space type.
Trait Implementations§
Source§impl VectorStore for OpenSearchVectorStore
impl VectorStore for OpenSearchVectorStore
Source§async fn upsert(
&self,
id: &str,
embedding: Vec<f32>,
document: Document,
) -> Result<()>
async fn upsert( &self, id: &str, embedding: Vec<f32>, document: Document, ) -> Result<()>
Inserts or updates a document with a pre-computed embedding vector.
Source§async fn upsert_many(
&self,
items: Vec<(String, Vec<f32>, Document)>,
) -> Result<()>
async fn upsert_many( &self, items: Vec<(String, Vec<f32>, Document)>, ) -> Result<()>
Inserts or updates a batch of documents with pre-computed embeddings. Read more
Source§async fn query(
&self,
embedding: Vec<f32>,
top_k: usize,
) -> Result<Vec<ScoredDocument>>
async fn query( &self, embedding: Vec<f32>, top_k: usize, ) -> Result<Vec<ScoredDocument>>
Queries the store for the
top_k most similar documents to the
given embedding vector. Returns results sorted by descending similarity.Auto Trait Implementations§
impl !RefUnwindSafe for OpenSearchVectorStore
impl !UnwindSafe for OpenSearchVectorStore
impl Freeze for OpenSearchVectorStore
impl Send for OpenSearchVectorStore
impl Sync for OpenSearchVectorStore
impl Unpin for OpenSearchVectorStore
impl UnsafeUnpin for OpenSearchVectorStore
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> ErasedVectorStore for Twhere
T: VectorStore,
impl<T> ErasedVectorStore for Twhere
T: VectorStore,
fn upsert_erased<'a>( &'a self, id: &'a str, embedding: Vec<f32>, document: Document, ) -> Pin<Box<dyn Future<Output = Result<(), DaimonError>> + Send + 'a>>
fn upsert_many_erased( &self, items: Vec<(String, Vec<f32>, Document)>, ) -> Pin<Box<dyn Future<Output = Result<(), DaimonError>> + Send + '_>>
fn query_erased<'a>( &'a self, embedding: Vec<f32>, top_k: usize, ) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredDocument>, DaimonError>> + Send + 'a>>
fn delete_erased<'a>( &'a self, id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<bool, DaimonError>> + Send + 'a>>
fn count_erased( &self, ) -> Pin<Box<dyn Future<Output = Result<usize, DaimonError>> + Send + '_>>
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 moreCreates a shared type from an unshared type.