Files
bookhoard/bruno/media-items/search/Search Media Items.yml
T
john-okeefe af3c3019cf refactor: reorganize Bruno API collection for better structure
- Remove obsolete scenarios/ folder and move requests to root media-items/
- Create new filters/ folder for field value autocomplete searches
- Move Field Values Search requests from search/ to filters/ for clarity
- Move Search Media Items from scenarios/ to search/ for consistency
- Update sequence numbers across all media-items requests (2-13)
- Remove redundant folder configuration files
- Improve API collection organization for better discoverability
2026-03-27 21:14:34 -04:00

64 lines
1.6 KiB
YAML

info:
name: Search Media Items
type: http
seq: 2
http:
method: GET
url: "{{base_url}}/api/media-items/search?q=harry"
headers:
- name: ""
value: application/json
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
## Search Media Items
Performs a search across all visible media items using partial matching with fuzzy fallback.
**Method:** GET
**Endpoint:** /api/media-items/search
**Authentication:** Required (Bearer token)
**Query Parameters:**
- `q` (string, required): Search query (minimum 2 characters)
**Search Behavior:**
1. First performs case-insensitive partial matching across:
- Title
- Author
- Series
- Tags
- Contributors
2. If no results found, falls back to fuzzy search using word_similarity with 0.3 threshold
**Response:** Array of media item objects (same structure as List Media Items)
**Status Codes:**
- 200: Success (results found)
- 404: No results found
- 400: Missing or invalid query parameter
- 401: Unauthorized
- 500: Internal server error
**Examples:**
- Search by title: `q=harry potter`
- Search by author: `q=king`
- Fuzzy search: `q=hary poter` (will find "harry potter")
**Ranking:**
Results are ranked by relevance:
- Title matches: Highest priority
- Author matches: High priority
- Series matches: Medium priority
- Tag matches: Lower priority
- Fuzzy matches: Sorted by similarity score