from datetime import datetime from pydantic import BaseModel from app.schemas.document import TagInfo class SearchResult(BaseModel): id: str title: str excerpt: str project_id: str tags: list[TagInfo] = [] score: float class SearchResponse(BaseModel): results: list[SearchResult] # ============================================================================= # Phase 3: Quick Switcher Schemas (Fuzzy Search) # ============================================================================= class QuickSwitcherItem(BaseModel): id: str type: str # "document" | "project" title: str subtitle: str | None = None highlight: str | None = None # HTML with tags icon: str | None = None project_id: str | None = None class QuickSwitcherResponse(BaseModel): query: str results: list[QuickSwitcherItem] total: int search_type: str = "fuzzy" class ProjectDocumentSearchItem(BaseModel): document_id: str title: str excerpt: str updated_at: datetime score: float class ProjectDocumentSearchResponse(BaseModel): project_id: str query: str results: list[ProjectDocumentSearchItem] total: int