openlibrary
openlibrary copied to clipboard
List search only finds exact matches: Switch to use Solr
~Blocked by: #2609~
Expanding on #364 Improve and expand list searching to search inside list titles.
A List search result is only given if the exact, full name of a list is used in the search. Searching on words that are only part of a list name returns "No results found."
Relevant url?
https://openlibrary.org/search/lists
Steps to Reproduce
- Go to ... https://openlibrary.org/search/lists
- Do ... enter a partial list name, for example, https://openlibrary.org/search/lists?q=banned
- Actual: only exact matches returned
- Expected: any list containing search term should be returned
Proposal & Constraints
We can now replace lists search with solr-backed list search since lists are now in solr! To do so, we will need to:
- add a new
SearchSchemefor lists; see the e.g.AuthorSearchSchemeas an example. - Update the /search/lists controller to now do a solr search instead https://github.com/internetarchive/openlibrary/blob/4f0c3c743685dc6bf8db7038b9aeb47e4a66c793/openlibrary/plugins/worksearch/code.py#L574-L597 . Follow the pattern from authors: https://github.com/internetarchive/openlibrary/blob/4f0c3c743685dc6bf8db7038b9aeb47e4a66c793/openlibrary/plugins/worksearch/code.py#L664-L674 .
- You might need to make some changes to https://github.com/internetarchive/openlibrary/blob/097f52e86c3bbbb65a31c4bc46000d259e30c504/openlibrary/templates/search/lists.html as well.
Stakeholders
@cdrini @seabelis @el4ctr0n