mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-02-21 19:54:50 -05:00
Implements comprehensive search functionality that intelligently routes between ephemeral (in-memory) and persistent (FTS5 database) indexes, following the directory listing pattern for consistency. **Backend Changes:** - Add IndexType enum (Persistent/Ephemeral/Hybrid) to communicate which index was used - Add FilterKind enum to indicate available filters for each search type - Implement ephemeral_search module with content type filtering via FileTypeRegistry - Update FileSearchOutput with index_type and available_filters fields - Add routing logic in FileSearchQuery to determine and use appropriate index - Support file type, size, date, and content type filters in ephemeral search **Frontend Changes:** - Add search mode to Explorer context (browse vs search with query/scope) - Create SearchView component with placeholder for search results - Wire up SearchBar with debounced search (300ms, min 2 chars) - Integrate search mode switching in ExplorerView router **Key Features:** - Fast, synchronous search (no events, no jobs) - Defaults to current folder scope (not global like Finder) - Backend as source of truth for all search operations - Content type filtering using FileTypeRegistry.identify_by_extension() - Ephemeral search supports: file types, size, dates, content types - Persistent search supports: all ephemeral filters + tags + locations **Architecture:** Follows the directory listing pattern: checks location index mode, queries database, falls back to ephemeral cache. Search results indicate which index was used and which filters are available for dynamic UI updates.