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§
Sourcefn provider_type(&self) -> SearchProviderType
fn provider_type(&self) -> SearchProviderType
Return the type of this search provider
Sourcefn list_indexes(&self, space_id: u64) -> Vec<IndexInfo>
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.
Sourcefn drop_index(
&self,
space_id: u64,
tag_name: &str,
field_name: &str,
) -> Result<(), String>
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§
Sourcefn description(&self) -> String
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".