Skip to main content

VectorStore

Trait VectorStore 

Source
pub trait VectorStore: Send + Sync {
    // Required methods
    fn ensure_collection(
        &self,
        collection: &str,
        vector_size: u64,
    ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>;
    fn collection_exists(
        &self,
        collection: &str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + '_>>;
    fn delete_collection(
        &self,
        collection: &str,
    ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>;
    fn upsert(
        &self,
        collection: &str,
        points: Vec<VectorPoint>,
    ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>;
    fn search(
        &self,
        collection: &str,
        vector: Vec<f32>,
        limit: u64,
        filter: Option<VectorFilter>,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredVectorPoint>, VectorStoreError>> + Send + '_>>;
    fn delete_by_ids(
        &self,
        collection: &str,
        ids: Vec<String>,
    ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>;
    fn scroll_all(
        &self,
        collection: &str,
        key_field: &str,
    ) -> Pin<Box<dyn Future<Output = Result<ScrollResult, VectorStoreError>> + Send + '_>>;
    fn health_check(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + '_>>;

    // Provided method
    fn create_keyword_indexes(
        &self,
        _collection: &str,
        _fields: &[&str],
    ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>> { ... }
}

Required Methods§

Source

fn ensure_collection( &self, collection: &str, vector_size: u64, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>

Source

fn collection_exists( &self, collection: &str, ) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + '_>>

Source

fn delete_collection( &self, collection: &str, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>

Source

fn upsert( &self, collection: &str, points: Vec<VectorPoint>, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>

Source

fn search( &self, collection: &str, vector: Vec<f32>, limit: u64, filter: Option<VectorFilter>, ) -> Pin<Box<dyn Future<Output = Result<Vec<ScoredVectorPoint>, VectorStoreError>> + Send + '_>>

Source

fn delete_by_ids( &self, collection: &str, ids: Vec<String>, ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>

Source

fn scroll_all( &self, collection: &str, key_field: &str, ) -> Pin<Box<dyn Future<Output = Result<ScrollResult, VectorStoreError>> + Send + '_>>

Source

fn health_check( &self, ) -> Pin<Box<dyn Future<Output = Result<bool, VectorStoreError>> + Send + '_>>

Provided Methods§

Source

fn create_keyword_indexes( &self, _collection: &str, _fields: &[&str], ) -> Pin<Box<dyn Future<Output = Result<(), VectorStoreError>> + Send + '_>>

Create keyword payload indexes for the given field names.

Default implementation is a no-op (for non-Qdrant backends).

Implementors§