optimize folder search: SQL-level filtering, user isolation, no in-memory filter; batch cascade trigger

This commit is contained in:
Dionisio
2026-02-24 17:15:36 +01:00
parent 6aa38d0d24
commit 28966ce28e
12 changed files with 361 additions and 131 deletions
+4 -1
View File
@@ -94,7 +94,10 @@ pub trait FolderUseCase: Send + Sync + 'static {
#[async_trait]
pub trait SearchUseCase: Send + Sync + 'static {
/// Performs a full search based on the specified criteria.
async fn search(&self, criteria: SearchCriteriaDto) -> Result<SearchResultsDto, DomainError>;
///
/// `user_id` identifies the authenticated user so that SQL queries filter
/// by owner and the result cache is isolated per tenant.
async fn search(&self, criteria: SearchCriteriaDto, user_id: &str) -> Result<SearchResultsDto, DomainError>;
/// Returns quick suggestions for autocomplete (lightweight, fast).
async fn suggest(