pub struct AnnSearcher {
pub collection_manager: Arc<CollectionManager>,
}Expand description
Core ANN search service.
Fields§
§collection_manager: Arc<CollectionManager>Collection and persistence coordinator used during search.
Implementations§
Source§impl AnnSearcher
impl AnnSearcher
Sourcepub fn new(collection_manager: Arc<CollectionManager>) -> Self
pub fn new(collection_manager: Arc<CollectionManager>) -> Self
Create a new ANN searcher.
Sourcepub async fn search(&self, query: SearchQuery) -> VectorResult<SearchResponse>
pub async fn search(&self, query: SearchQuery) -> VectorResult<SearchResponse>
Execute a nearest-neighbour search and return filtered, ranked results with metrics.
Sourcepub async fn search_in_workspace(
&self,
workspace_id: &str,
query: SearchQuery,
) -> VectorResult<SearchResponse>
pub async fn search_in_workspace( &self, workspace_id: &str, query: SearchQuery, ) -> VectorResult<SearchResponse>
Execute a nearest-neighbour search scoped to a workspace.
Sourcepub async fn search_by_text(
&self,
collection: &str,
text: &str,
top_k: usize,
embedding_client: &EmbeddingClient,
) -> VectorResult<SearchResponse>
pub async fn search_by_text( &self, collection: &str, text: &str, top_k: usize, embedding_client: &EmbeddingClient, ) -> VectorResult<SearchResponse>
Embed free-form text and execute ANN search.
Sourcepub async fn search_by_text_in_workspace(
&self,
workspace_id: &str,
collection: &str,
text: &str,
top_k: usize,
embedding_client: &EmbeddingClient,
) -> VectorResult<SearchResponse>
pub async fn search_by_text_in_workspace( &self, workspace_id: &str, collection: &str, text: &str, top_k: usize, embedding_client: &EmbeddingClient, ) -> VectorResult<SearchResponse>
Embed free-form text and execute workspace-scoped ANN search.
Sourcepub async fn batch_search(
&self,
queries: Vec<SearchQuery>,
) -> VectorResult<Vec<SearchResponse>>
pub async fn batch_search( &self, queries: Vec<SearchQuery>, ) -> VectorResult<Vec<SearchResponse>>
Execute multiple ANN queries concurrently.
Auto Trait Implementations§
impl Freeze for AnnSearcher
impl !RefUnwindSafe for AnnSearcher
impl Send for AnnSearcher
impl Sync for AnnSearcher
impl Unpin for AnnSearcher
impl UnsafeUnpin for AnnSearcher
impl !UnwindSafe for AnnSearcher
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request