pub enum TenantSearchIndex {
Typesense(TypesenseIndex),
OpenSearch(OpenSearchIndex),
Database(DatabaseSearchIndex),
}Variants§
Implementations§
Source§impl TenantSearchIndex
impl TenantSearchIndex
Sourcepub async fn create_index(&self) -> Result<(), SearchError>
pub async fn create_index(&self) -> Result<(), SearchError>
Creates a search index for the tenant
Sourcepub async fn index_exists(&self) -> Result<bool, SearchError>
pub async fn index_exists(&self) -> Result<bool, SearchError>
Checks if the tenant search index exists
Sourcepub async fn delete_index(&self) -> Result<(), SearchError>
pub async fn delete_index(&self) -> Result<(), SearchError>
Deletes the search index for the tenant
Sourcepub async fn search_index(
&self,
scope: &[String],
query: SearchRequest,
folder_children: Option<Vec<Uuid>>,
) -> Result<SearchResults, SearchError>
pub async fn search_index( &self, scope: &[String], query: SearchRequest, folder_children: Option<Vec<Uuid>>, ) -> Result<SearchResults, SearchError>
Searches the search index with the provided query
Sourcepub async fn search_index_file(
&self,
scope: &String,
file_id: Uuid,
query: FileSearchRequest,
) -> Result<FileSearchResults, SearchError>
pub async fn search_index_file( &self, scope: &String, file_id: Uuid, query: FileSearchRequest, ) -> Result<FileSearchResults, SearchError>
Searches the index for matches scoped to a specific file
Sourcepub async fn add_data(
&self,
data: Vec<SearchIndexData>,
) -> Result<(), SearchError>
pub async fn add_data( &self, data: Vec<SearchIndexData>, ) -> Result<(), SearchError>
Adds the provided data to the search index
Sourcepub async fn update_data(
&self,
item_id: Uuid,
data: UpdateSearchIndexData,
) -> Result<(), SearchError>
pub async fn update_data( &self, item_id: Uuid, data: UpdateSearchIndexData, ) -> Result<(), SearchError>
Updates the provided data in the search index
Sourcepub async fn delete_data(&self, id: Uuid) -> Result<(), SearchError>
pub async fn delete_data(&self, id: Uuid) -> Result<(), SearchError>
Deletes the provided data from the search index by id
Sourcepub async fn delete_by_scope(&self, scope: &str) -> Result<(), SearchError>
pub async fn delete_by_scope(&self, scope: &str) -> Result<(), SearchError>
Deletes all data contained within the specified scope
Sourcepub async fn get_pending_migrations(
&self,
applied_names: Vec<String>,
) -> Result<Vec<String>, SearchError>
pub async fn get_pending_migrations( &self, applied_names: Vec<String>, ) -> Result<Vec<String>, SearchError>
Get all pending migrations based on the applied_names list of applied migrations
Sourcepub async fn apply_migration(
&self,
tenant: &Tenant,
root_t: &mut Transaction<'_, Postgres>,
tenant_t: &mut Transaction<'_, Postgres>,
name: &str,
) -> Result<(), SearchError>
pub async fn apply_migration( &self, tenant: &Tenant, root_t: &mut Transaction<'_, Postgres>, tenant_t: &mut Transaction<'_, Postgres>, name: &str, ) -> Result<(), SearchError>
Apply a specific migration for a tenant by name
Sourcepub async fn apply_migrations(
&self,
tenant: &Tenant,
root_t: &mut Transaction<'_, Postgres>,
tenant_t: &mut Transaction<'_, Postgres>,
target_migration_name: Option<&str>,
) -> Result<(), SearchError>
pub async fn apply_migrations( &self, tenant: &Tenant, root_t: &mut Transaction<'_, Postgres>, tenant_t: &mut Transaction<'_, Postgres>, target_migration_name: Option<&str>, ) -> Result<(), SearchError>
Apply all pending migrations for a tenant
When target_migration_name is specified only that target migration will
be run
Trait Implementations§
Source§impl Clone for TenantSearchIndex
impl Clone for TenantSearchIndex
Source§fn clone(&self) -> TenantSearchIndex
fn clone(&self) -> TenantSearchIndex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TenantSearchIndex
impl !RefUnwindSafe for TenantSearchIndex
impl Send for TenantSearchIndex
impl Sync for TenantSearchIndex
impl Unpin for TenantSearchIndex
impl !UnwindSafe for TenantSearchIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.