pub struct SemanticSearch { /* private fields */ }Expand description
Semantic search engine for querying embeddings databases
Implementations§
Source§impl SemanticSearch
impl SemanticSearch
Sourcepub fn new<P: AsRef<Path>>(embeddings_path: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(embeddings_path: P) -> Result<Self>
Create a new semantic search instance by loading an embeddings database
Sourcepub fn metadata(&self) -> EmbeddingsDatabaseMetadata
pub fn metadata(&self) -> EmbeddingsDatabaseMetadata
Get metadata about the loaded database
Sourcepub fn search(&mut self, query: &str, top_n: usize) -> Result<Vec<SearchResult>>
pub fn search(&mut self, query: &str, top_n: usize) -> Result<Vec<SearchResult>>
Perform a semantic search with the given query
Returns the top N results ranked by cosine similarity
Sourcepub fn chunk_count(&self) -> usize
pub fn chunk_count(&self) -> usize
Get the total number of chunks in the database
Auto Trait Implementations§
impl !Freeze for SemanticSearch
impl !RefUnwindSafe for SemanticSearch
impl Send for SemanticSearch
impl Sync for SemanticSearch
impl Unpin for SemanticSearch
impl UnsafeUnpin for SemanticSearch
impl !UnwindSafe for SemanticSearch
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> 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