[GrandComicsDatabase/gcd-django] Add ranked Series title search (PR #777)

4 views
Skip to first unread message

Adam Hernandez

unread,
2:09 PM (5 hours ago) 2:09 PM
to GrandComicsDatabase/gcd-django, Subscribed

This adds a search filter to GET /api/v2/series/ so clients can find the most likely Series without paging through thousands of alphabetically ordered substring matches. I kept the existing name filter unchanged.

The ranking is deterministic: case-insensitive exact title, title prefix, token prefix, then general substring. Ties use sort_name, year_began, and id, so pagination stays stable. Query whitespace is normalized, punctuation is treated literally, and title matching is accent-sensitive so a title such as Båtman does not rank as an exact Batman match.

I tested this against the current full public dump with 232,238 active Series. Repeating the first 200 Batman results returned the same IDs, page 2 had no overlap, and all 133 exact-title matches came first. Measured endpoint latency was:

Query Matches First request Warm median
Batman 3,723 606.0 ms 259.9 ms
Spider-Man 1,955 242.5 ms 231.3 ms
X 13,983 213.3 ms 216.3 ms
A (stress case) 177,030 333.7 ms 322.1 ms

The filter composes with the existing Series filters and is included in the OpenAPI schema. There is no migration or model change.

Validation:

  • pytest -q apps/api_v2/tests — 329 passed
  • ruff check apps/api_v2/
  • ruff format --check apps/api_v2/
  • python manage.py check
  • python manage.py makemigrations --check --dry-run
  • python manage.py migrate --check

You can view, comment on, or merge this pull request online at:

  https://github.com/GrandComicsDatabase/gcd-django/pull/777

Commit Summary

  • bffe701 feat(api-v2): add ranked series title search

File Changes

(4 files)

Patch Links:

—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <GrandComicsDatabase/gcd-django/pull/777@github.com>

Reply all
Reply to author
Forward
0 new messages