lance_index

Trait Index

Source
pub trait Index:
    Send
    + Sync
    + DeepSizeOf {
    // Required methods
    fn as_any(&self) -> &dyn Any;
    fn as_index(self: Arc<Self>) -> Arc<dyn Index>;
    fn as_vector_index(self: Arc<Self>) -> Result<Arc<dyn VectorIndex>>;
    fn statistics(&self) -> Result<Value>;
    fn index_type(&self) -> IndexType;
    fn calculate_included_frags<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<RoaringBitmap>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generic methods common across all types of secondary indices

Required Methods§

Source

fn as_any(&self) -> &dyn Any

Cast to Any.

Source

fn as_index(self: Arc<Self>) -> Arc<dyn Index>

Cast to Index

Source

fn as_vector_index(self: Arc<Self>) -> Result<Arc<dyn VectorIndex>>

Source

fn statistics(&self) -> Result<Value>

Retrieve index statistics as a JSON Value

Source

fn index_type(&self) -> IndexType

Get the type of the index

Source

fn calculate_included_frags<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<RoaringBitmap>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read through the index and determine which fragment ids are covered by the index

This is a kind of slow operation. It’s better to use the fragment_bitmap. This only exists for cases where the fragment_bitmap has become corrupted or missing.

Implementors§