pub trait QueryableIndex: Send + Sync {
// Required methods
fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
embedding: &'life1 [f32],
k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn distance_metric(&self) -> DistanceMetric;
fn index_id(&self) -> String;
fn size(&self) -> usize;
}Expand description
A queryable index interface
Required Methods§
Sourcefn query<'life0, 'life1, 'async_trait>(
&'life0 self,
embedding: &'life1 [f32],
k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn query<'life0, 'life1, 'async_trait>(
&'life0 self,
embedding: &'life1 [f32],
k: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<SearchResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Query the index with an embedding
Sourcefn distance_metric(&self) -> DistanceMetric
fn distance_metric(&self) -> DistanceMetric
Get the distance metric used by this index