Skip to main content

search_prefix

Function search_prefix 

Source
pub async fn search_prefix(
    profile_id: ProfileId,
    bucket: BucketId,
    prefix: String,
    query: String,
    request_id: String,
    store: State<'_, ProfileStoreHandle>,
    pool: State<'_, S3ClientPoolHandle>,
    search_registry: State<'_, SearchRegistryHandle>,
    settings: State<'_, SettingsHandle>,
    channel: AppHandle,
) -> Result<String, AppError>
Expand description

Begin a paginated, cancellable prefix search.

Returns request_id immediately. A background tokio task walks ListObjectsV2 pages starting at prefix, filtering each page by query (case-insensitive substring on the key relative to prefix), and emits a search:page event for each batch of matching results.

Walk concurrency is capped by the transfer_concurrency setting to avoid monopolising the S3 connection pool.

ยงCancellation

Call search_cancel(request_id) to stop the walk. The background task checks the cancellation token between pages; on cancellation it emits a final empty page with is_final = true and exits.