Skip to content

fix: Json searching by key:/books/ , key:/isbn/ #11686

Closed
Pahari47 wants to merge 1 commit intointernetarchive:masterfrom
Pahari47:pathfix
Closed

fix: Json searching by key:/books/ , key:/isbn/ #11686
Pahari47 wants to merge 1 commit intointernetarchive:masterfrom
Pahari47:pathfix

Conversation

@Pahari47
Copy link

@Pahari47 Pahari47 commented Jan 11, 2026

Closes #11683

Technical

  1. Added rewrite_edition_and_isbn_keys() to rewrite key queries before Solr processing.
  2. Integrated into _prepare_work_search_query() running after rewrite_list_query().
  3. Uses regex with lookaheads to match and transform:
    key:/books/OL29345231M to edition_key:OL29345231M (extracts basename)
    key:/isbn/1234567890 to isbn:1234567890

Testing

Note: I am using my local port and keys of books, works, isbn so add yours

  1. turn on server and solr
  2. go to any browser

/books/

url:

http://localhost:8080/search.json?q=key:/books/OL4M&fields=key,title,author_name,number_of_pages_median,first_publish_year,isbn,ratings_score,first_sentence,title_suggest,rating*,cover*

expected output:

image

/isbn/

url:

http://localhost:8080/search.json?q=key:/isbn/0863224334&fields=key,title,author_name,isbn

expected output:

image

/works/

url:

http://localhost:8080/search.json?q=key:/works/OL286730W&fields=key,title,author_name,number_of_pages_median,first_publish_year,isbn,ratings_score,first_sentence,title_suggest,rating*,cover*

expected output:

image

multiple search

url:

http://localhost:8080/search.json?q=key:/books/OL4M%20OR%20key:/books/OL24218089M&fields=key,title,author_name,edition_key

expected output:

image

Stakeholders

@mekarpeles
@cdrini

@jimchamp
Copy link
Collaborator

Closing this, as the linked issue was closed.

It's inadvisable to work on issues that have the Needs: Triage label. Such issues have not yet been reviewed by staff, and can be closed at any time.

@jimchamp jimchamp closed this Jan 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Json searching by key:/books/ or key:/isbn/ no longer works

2 participants