Files
bookhoard/bruno/media-items/Exact Match With Quotes.yml
T
john-okeefe 74009f66b5 refactor: restructure Bruno API collection for consistency
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.
2026-03-25 18:03:00 -04:00

79 lines
2.1 KiB
YAML

info:
name: Exact Match With Quotes
type: http
seq: 5
http:
method: GET
url: '{{base_url}}/api/media-items/search?library_id={{library_id}}&q="Foundation and Empire"'
params:
- name: library_id
value: "{{library_id}}"
type: query
- name: q
value: '"Foundation and Empire"'
type: query
auth: inherit
settings:
encodeUrl: true
timeout: 0
followRedirects: true
maxRedirects: 5
docs: |-
## Exact Match With Quotes
Searches for an exact phrase match by wrapping the query in double quotes.
**Method:** GET
**Endpoint:** /api/media-items/search
**Authentication:** Required (Bearer token)
**Query Parameters:**
- `library_id` (string, required): Library UUID to search within
- `q` (string, required): Exact phrase to match (must be wrapped in double quotes)
**How Exact Match Works:**
- Wrap query in double quotes: `"\"exact phrase\""`
- Uses ILIKE pattern matching with wildcards
- Case-insensitive
- Must match the exact phrase (no fuzzy matching)
- Searches in: title, author, series, tags, contributors
**Fuzzy vs Exact Match:**
- Fuzzy (default): `asimov` → Matches "Asimov, Isaac", "Foundation and Asimov"
- Exact (with quotes): `"\"Asimov, Isaac\""` → Matches ONLY "Asimov, Isaac"
**Response:** HTTP 200 (OK)
```json
[
{
"id": "uuid",
"title": "Foundation and Empire",
"author": "Asimov, Isaac",
"library_id": "uuid",
"library_name": "E-Books"
}
]
```
**Examples:**
- `q="\"Foundation and Empire\""` → Only "Foundation and Empire" (not "Foundation")
- `q="\"The Hobbit\""` → Only "The Hobbit" (not "The Hobbit: There and Back Again")
- `q="\"J.R.R. Tolkien\""` → Only exact author name match
**When to Use Exact Match:**
- Searching for exact book titles in a series
- Finding specific edition or version
- Exact author name matching
- Preventing false positives from similar terms
**Success Criteria:**
- Status: 200
- Returns items with exact phrase match
- No fuzzy matching applied
- Case-insensitive but must match exactly otherwise