- 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.
93 lines
2.3 KiB
YAML
93 lines
2.3 KiB
YAML
info:
|
|
name: Field Values Search - Authors
|
|
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: author
|
|
value: "asimov"
|
|
type: query
|
|
disabled: false
|
|
- name: limit
|
|
value: "50"
|
|
type: query
|
|
disabled: false
|
|
auth: inherit
|
|
|
|
settings:
|
|
encodeUrl: true
|
|
timeout: 0
|
|
followRedirects: true
|
|
maxRedirects: 5
|
|
|
|
docs: |-
|
|
## Field Values Search - Authors
|
|
|
|
Fetches distinct author values for autocomplete dropdowns with counts and similarity scores.
|
|
|
|
**Method:** GET
|
|
|
|
**Endpoint:** /api/media-items/search
|
|
|
|
**Authentication:** Required (Bearer token)
|
|
|
|
**Query Parameters:**
|
|
- `library_id` (string, required): Library UUID to search within
|
|
- `author` (string, required): Author name to search for (fuzzy match)
|
|
- `limit` (integer, optional): Maximum results to return (default: 50)
|
|
|
|
**How It Works:**
|
|
- Returns distinct author names from the library
|
|
- Fuzzy matches the search query against author names
|
|
- Includes count of books per author
|
|
- Includes similarity score (0-1, higher = better match)
|
|
- Sorted by similarity score, then by count
|
|
|
|
**Use Case:**
|
|
- Populate autocomplete dropdown when user types in author filter field
|
|
- Show user available authors with book counts
|
|
- Help users discover similar author names
|
|
|
|
**Response:** HTTP 200 (OK)
|
|
```json
|
|
{
|
|
"results": [
|
|
{
|
|
"value": "Asimov, Isaac",
|
|
"count": 47,
|
|
"score": 0.8
|
|
},
|
|
{
|
|
"value": "Asimov, Isaac & Robert Silverberg",
|
|
"count": 2,
|
|
"score": 0.75
|
|
}
|
|
],
|
|
"total": 2
|
|
}
|
|
```
|
|
|
|
**Examples:**
|
|
- `author=asimov` → Returns "Asimov, Isaac" (47 books), "Asimov, Isaac & Robert Silverberg" (2 books)
|
|
- `author=rowling` → Returns "Rowling, J.K." (10 books)
|
|
- `author=tolkien` → Returns "Tolkien, J.R.R." (15 books)
|
|
|
|
**Frontend Integration:**
|
|
- Call this endpoint when user types ≥2 characters in author field
|
|
- Display results in `<datalist>` or custom dropdown
|
|
- Show: "Author Name (count)" format
|
|
- Allow user to select from suggestions
|
|
|
|
**Success Criteria:**
|
|
- Status: 200
|
|
- Returns array of author values with counts
|
|
- Results sorted by relevance (similarity score)
|
|
- Only returns authors matching the fuzzy search
|