pub trait TextSearch:
Send
+ Sync
+ 'static {
// Required methods
fn upsert_document<'life0, 'async_trait>(
&'life0 self,
document: TextDocument,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn upsert_documents<'life0, 'async_trait>(
&'life0 self,
documents: Vec<TextDocument>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_document<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
subject_id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_document<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
subject_id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<TextDocument>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn search<'life0, 'async_trait>(
&'life0 self,
request: TextSearchRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<TextSearchHit>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn count<'life0, 'async_trait>(
&'life0 self,
filter: TextFilter,
) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StorageResult<TextIndexStats>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn rebuild<'life0, 'async_trait>(
&'life0 self,
scope: IndexRebuildScope,
) -> Pin<Box<dyn Future<Output = StorageResult<TextIndexStats>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn search_with_options<'life0, 'async_trait>(
&'life0 self,
request: TextSearchRequest,
options: TextSearchOptions,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<TextSearchHit>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn term_stats<'life0, 'async_trait>(
&'life0 self,
_request: TextTermStatsRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<TextTermStats>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Full-text search capability over indexed documents.
Required Methods§
Sourcefn upsert_document<'life0, 'async_trait>(
&'life0 self,
document: TextDocument,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_document<'life0, 'async_trait>(
&'life0 self,
document: TextDocument,
) -> Pin<Box<dyn Future<Output = StorageResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Index or update a single text document.
Sourcefn upsert_documents<'life0, 'async_trait>(
&'life0 self,
documents: Vec<TextDocument>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn upsert_documents<'life0, 'async_trait>(
&'life0 self,
documents: Vec<TextDocument>,
) -> Pin<Box<dyn Future<Output = StorageResult<BatchWriteSummary>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Index or update a batch of text documents.
Sourcefn delete_document<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
subject_id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_document<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
subject_id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a document from the text index.
Sourcefn get_document<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
subject_id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<TextDocument>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_document<'life0, 'life1, 'async_trait>(
&'life0 self,
namespace: &'life1 str,
subject_id: Uuid,
) -> Pin<Box<dyn Future<Output = StorageResult<Option<TextDocument>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch an indexed document by namespace and subject ID.
Sourcefn search<'life0, 'async_trait>(
&'life0 self,
request: TextSearchRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<TextSearchHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn search<'life0, 'async_trait>(
&'life0 self,
request: TextSearchRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<TextSearchHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Run a full-text search query and return ranked hits.
Sourcefn count<'life0, 'async_trait>(
&'life0 self,
filter: TextFilter,
) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn count<'life0, 'async_trait>(
&'life0 self,
filter: TextFilter,
) -> Pin<Box<dyn Future<Output = StorageResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Count documents matching a filter.
Sourcefn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StorageResult<TextIndexStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stats<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = StorageResult<TextIndexStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return index metadata and health statistics.
Sourcefn rebuild<'life0, 'async_trait>(
&'life0 self,
scope: IndexRebuildScope,
) -> Pin<Box<dyn Future<Output = StorageResult<TextIndexStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn rebuild<'life0, 'async_trait>(
&'life0 self,
scope: IndexRebuildScope,
) -> Pin<Box<dyn Future<Output = StorageResult<TextIndexStats>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Rebuild the text index, optionally scoped to a subset of entries.
Provided Methods§
Sourcefn search_with_options<'life0, 'async_trait>(
&'life0 self,
request: TextSearchRequest,
options: TextSearchOptions,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<TextSearchHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn search_with_options<'life0, 'async_trait>(
&'life0 self,
request: TextSearchRequest,
options: TextSearchOptions,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<TextSearchHit>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Search with explicit gather options (candidate-gather optimization).
Default delegates to search when options are default (Ranked mode).
Backends that do not implement this return StorageError::Unsupported
for non-default options, which the caller must handle by falling back
or propagating.
Sourcefn term_stats<'life0, 'async_trait>(
&'life0 self,
_request: TextTermStatsRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<TextTermStats>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn term_stats<'life0, 'async_trait>(
&'life0 self,
_request: TextTermStatsRequest,
) -> Pin<Box<dyn Future<Output = StorageResult<Vec<TextTermStats>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Return per-term document frequency and IDF for a set of query terms.
Default returns StorageError::Unsupported. Only FTS5-backed stores
provide a concrete implementation.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".