search
backend.api.search
Section titled “backend.api.search”search endpoints for relay.
Functions
Section titled “Functions”unified_search source
Section titled “unified_search source”unified_search(db: Annotated[AsyncSession, Depends(get_db)], q: str = Query(..., min_length=2, max_length=100, description='search query'), type: str | None = Query(None, description='filter by type: tracks, artists, albums, tags (comma-separated for multiple)'), limit: int = Query(20, ge=1, le=50, description='max results per type')) -> SearchResponseunified search across tracks, artists, albums, and tags.
uses pg_trgm for fuzzy matching with similarity scoring. results are sorted by relevance within each type.
semantic_search source
Section titled “semantic_search source”semantic_search(db: Annotated[AsyncSession, Depends(get_db)], q: str = Query(..., min_length=3, max_length=200, description='text description of desired audio'), limit: int = Query(10, ge=1, le=50, description='max results')) -> SemanticSearchResponsesemantic audio search — describe a mood and get matching tracks.
uses CLAP embeddings to match text descriptions to audio content. no auth required (matches existing /search/ pattern). returns 503 if embedding services are disabled.
Classes
Section titled “Classes”TrackSearchResult source
Section titled “TrackSearchResult source”track search result.
ArtistSearchResult source
Section titled “ArtistSearchResult source”artist search result.
AlbumSearchResult source
Section titled “AlbumSearchResult source”album search result.
TagSearchResult source
Section titled “TagSearchResult source”tag search result.
PlaylistSearchResult source
Section titled “PlaylistSearchResult source”playlist search result.
SearchResponse source
Section titled “SearchResponse source”unified search response.
SemanticTrackResult source
Section titled “SemanticTrackResult source”a track result from semantic audio search.
SemanticSearchResponse source
Section titled “SemanticSearchResponse source”response from semantic search endpoint.