Skip to content

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

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

1 participant