- Update Search All Libraries.yml with expanded documentation - Add Fuzzy Author Filter.yml (author_filter=asimov example) - Add Fuzzy Genre Filter.yml (genre_filter=scifi example) - Add Combined Search and Filters.yml (q=foundation&author_filter=asimov example) - Add Exact Match With Quotes.yml (q="Foundation and Empire" example) - Add Field Values Search - Authors.yml (autocomplete dropdown example) - Add Field Values Search - Genres.yml (autocomplete dropdown example) - Add Field Values Search - Series.yml (autocomplete dropdown example) - Add Field Values Search - Languages.yml (autocomplete dropdown example) - Remove deprecated Filter Media Items.yml scenario All files include request config, params, examples, expected responses, and success criteria for API interaction during development.
71 lines
1.6 KiB
YAML
71 lines
1.6 KiB
YAML
info:
|
|
name: Fuzzy Genre Filter
|
|
type: http
|
|
seq: 1
|
|
|
|
http:
|
|
method: GET
|
|
url: "{{base_url}}/api/media-items/search"
|
|
params:
|
|
- name: library_id
|
|
value: "{{library_id}}"
|
|
type: query
|
|
disabled: false
|
|
- name: genre_filter
|
|
value: "scifi"
|
|
type: query
|
|
disabled: false
|
|
auth: inherit
|
|
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|
|
|
|
docs: |-
|
|
## Fuzzy Genre Filter
|
|
|
|
Filters media items by genre using fuzzy matching (tolerates typos and variations).
|
|
|
|
**Method:** GET
|
|
|
|
**Endpoint:** /api/media-items/search
|
|
|
|
**Authentication:** Required (Bearer token)
|
|
|
|
**Query Parameters:**
|
|
- `library_id` (string, required): Library UUID to search within
|
|
- `genre_filter` (string, required): Genre to fuzzy match (e.g., "scifi" matches "Sci-Fi", "Science Fiction")
|
|
|
|
**How Fuzzy Matching Works:**
|
|
- Uses PostgreSQL pg_trgm word_similarity()
|
|
- Threshold: 0.3 (30% similarity)
|
|
- Handles variations: "scifi" → "Sci-Fi", "Science Fiction"
|
|
- Handles typos: "fantacy" → "Fantasy"
|
|
- Case-insensitive
|
|
|
|
**Response:** HTTP 200 (OK)
|
|
```json
|
|
[
|
|
{
|
|
"id": "uuid",
|
|
"title": "Foundation",
|
|
"author": "Asimov, Isaac",
|
|
"genre": "Sci-Fi",
|
|
"library_id": "uuid",
|
|
"library_name": "E-Books"
|
|
}
|
|
]
|
|
```
|
|
|
|
**Examples:**
|
|
- `genre_filter=scifi` → Matches "Sci-Fi", "Science Fiction"
|
|
- `genre_filter=fantasy` → Matches "Fantasy", "High Fantasy"
|
|
- `genre_filter=mystery` → Matches "Mystery", "Mystery/Thriller"
|
|
|
|
**Success Criteria:**
|
|
- Status: 200
|
|
- Returns items with genres similar to the filter
|
|
- Results sorted by similarity score
|