Skip to main content

SearchProvider

Trait SearchProvider 

Source
pub trait SearchProvider:
    Send
    + Sync
    + Debug
    + 'static {
    // Required methods
    fn name(&self) -> &str;
    fn provider_type(&self) -> SearchProviderType;
    fn list_indexes(&self, space_id: u64) -> Vec<IndexInfo>;
    fn drop_index(
        &self,
        space_id: u64,
        tag_name: &str,
        field_name: &str,
    ) -> Result<(), String>;

    // Provided method
    fn description(&self) -> String { ... }
}
Expand description

Common trait for search providers

This trait provides a unified interface for different search backends (fulltext, vector) to be discovered and managed through a common API. It covers index metadata, lifecycle, and basic search operations that every backend supports.

Provider-specific operations (vector embedding, fulltext engine type, consistency options) remain on the concrete wrapper types and are accessed through SearchContext when the operator knows which backend it is talking to.

Required Methods§

Source

fn name(&self) -> &str

Return the name of this search provider

Source

fn provider_type(&self) -> SearchProviderType

Return the type of this search provider

Source

fn list_indexes(&self, space_id: u64) -> Vec<IndexInfo>

List search indexes for a given space.

Returns all indexes (fulltext or vector) that belong to space_id. When space_id is 0 or not applicable, returns all indexes.

Source

fn drop_index( &self, space_id: u64, tag_name: &str, field_name: &str, ) -> Result<(), String>

Drop a search index identified by (space_id, tag_name, field_name).

Returns Ok(()) on success, or an error string describing what went wrong. The error is intentionally opaque (String) so that both SearchError and VectorCoordinatorError can be surfaced without introducing a shared error enum at the trait level.

Provided Methods§

Source

fn description(&self) -> String

Return a human-readable description of this provider

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§