QueryableIndex

Trait QueryableIndex 

Source
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§

Source

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

Source

fn distance_metric(&self) -> DistanceMetric

Get the distance metric used by this index

Source

fn index_id(&self) -> String

Get index identifier

Source

fn size(&self) -> usize

Get index size (number of entries)

Implementors§