- Update Combined Search and Filters to use tags_filter - Update Field Values Search to cover tags autocomplete - Add fuzzy matching examples for tags - Update search scenarios to use tags instead of genre Updates the Bruno API test collection to use the new tags filter instead of the genre filter, including fuzzy matching examples. Relates to IMPLEMENTATION_TAGS_FILTER.md Phase 6
69 lines
1.6 KiB
YAML
69 lines
1.6 KiB
YAML
info:
|
|
name: Fuzzy Genre Filter
|
|
type: http
|
|
seq: 11
|
|
|
|
http:
|
|
method: GET
|
|
url: "{{base_url}}/api/media-items/search?library_id={{library_id}}&tags_filter=scifi"
|
|
params:
|
|
- name: library_id
|
|
value: "{{library_id}}"
|
|
type: query
|
|
- name: tags_filter
|
|
value: scifi
|
|
type: query
|
|
auth: inherit
|
|
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|
|
|
|
docs: |-
|
|
## Fuzzy Genre Filter
|
|
|
|
Filters media items by tags 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
|
|
- `tags_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",
|
|
"tags": "Sci-Fi",
|
|
"library_id": "uuid",
|
|
"library_name": "E-Books"
|
|
}
|
|
]
|
|
```
|
|
|
|
**Examples:**
|
|
- `tags_filter=scifi` → Matches "Sci-Fi", "Science Fiction"
|
|
- `tags_filter=fantasy` → Matches "Fantasy", "High Fantasy"
|
|
- `tags_filter=mystery` → Matches "Mystery", "Mystery/Thriller"
|
|
|
|
**Success Criteria:**
|
|
- Status: 200
|
|
- Returns items with tagss similar to the filter
|
|
- Results sorted by similarity score
|