Skip to content

Fixed series autocomplete to correctly resolve OL IDs and URLs, added tests.#12123

Open
Saad259 wants to merge 2 commits intointernetarchive:masterfrom
Saad259:fix-series-autocomplete-olid-lookup
Open

Fixed series autocomplete to correctly resolve OL IDs and URLs, added tests.#12123
Saad259 wants to merge 2 commits intointernetarchive:masterfrom
Saad259:fix-series-autocomplete-olid-lookup

Conversation

@Saad259
Copy link
Contributor

@Saad259 Saad259 commented Mar 18, 2026

Closes #12094

olid_to_key maps the L suffix to /lists/, but series records live under /series/. This fix adds an olid_to_key method to the base autocomplete class and replaces the direct olid_to_key() call in direct_get with self.olid_to_key() . series_autocomplete then overrides this method to return the correct /series/ prefix, keeping the change minimal and the base class behaviour unchanged for all other autocomplete types.

Technical

Testing

  1. Run the test suite: pytest openlibrary/plugins/worksearch/tests/test_autocomplete.py -v. All 4 tests pass, including two new tests covering bare OL ID and full URL lookup for series
  2. Previously olid_to_key mapped the L suffix to /lists/, causing the Solr query to search key:"/lists/OL327669L" which returned no results

Screenshot

N/A only backend change

Stakeholders

@cdrini

@github-actions github-actions bot added the Priority: 2 Important, as time permits. [managed] label Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: 2 Important, as time permits. [managed]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Book Series: Ability to add series by its OLID

2 participants