Skip to main content

VectorStoreIndexDyn

Trait VectorStoreIndexDyn 

Source
pub trait VectorStoreIndexDyn: WasmCompatSend + WasmCompatSync {
    // Required methods
    fn top_n<'a>(
        &'a self,
        req: VectorSearchRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(f64, String, Value)>, VectorStoreError>> + Send + 'a>>;
    fn top_n_ids<'a>(
        &'a self,
        req: VectorSearchRequest,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<(f64, String)>, VectorStoreError>> + Send + 'a>>;
}
Expand description

Type-erased VectorStoreIndex for dynamic dispatch.

Required Methods§

Source

fn top_n<'a>( &'a self, req: VectorSearchRequest, ) -> Pin<Box<dyn Future<Output = Result<Vec<(f64, String, Value)>, VectorStoreError>> + Send + 'a>>

Returns the top N documents for a JSON-serializable request.

Source

fn top_n_ids<'a>( &'a self, req: VectorSearchRequest, ) -> Pin<Box<dyn Future<Output = Result<Vec<(f64, String)>, VectorStoreError>> + Send + 'a>>

Returns only the top N document IDs for a JSON-serializable request.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<I, F> VectorStoreIndexDyn for I
where I: VectorStoreIndex<Filter = F>, F: DynamicSearchFilter + WasmCompatSend + WasmCompatSync + 'static,