Standardize all Bruno API request files with consistent formatting and structure to improve maintainability and readability. Changes include: - Consolidate URL parameters into main URL instead of separate definitions - Standardize quote style (double quotes throughout) - Add proper settings section with defaults (timeout, redirects, etc.) - Improve YAML formatting with literal style for multi-line content - Remove redundant fields (disabled: false) - Clean up header and body structure - Update sequence numbers for better organization - Add scenarios folder structure for organized test groupings Removes obsolete Search Invalid Library ID test case. Environment configuration updated with new library_id for testing. These changes improve the Bruno collection's maintainability and make it easier to create new API requests following established patterns.
64 lines
1.6 KiB
YAML
64 lines
1.6 KiB
YAML
info:
|
|
name: Search Media Items
|
|
type: http
|
|
seq: 1
|
|
|
|
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
|