Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Created a Fulltext Suggestion Macro for 0 Results #9332

Conversation

merwhite11
Copy link
Collaborator

@merwhite11 merwhite11 commented May 24, 2024

Closes #1001

Feature:
Creates a partial that is rendered within work_search.html in the case when 0 results are returned from a search.

The Fulltext-Search-Suggestion partial retrieves data from the Partials endpoint and renders a card with two suggestions of books with fulltext snippets that match the user's query. If the suggested book or title is clicked, it leads to the book's page. If the fulltext snippet or header/footer is clicked, it leads to the Search Inside results page.

Edge Cases:

  • If there are no results for a given Search Tab AND no Search Inside results -> Only the 'No results' message will appear, no Search Inside suggestions
  • All Search categories (books, authors, subjects, lists) return a Search Inside suggestion card if there are 0 category results
  • All Search categories return a consistent 'No results' message if there are no category results and no Search Inside matches.

Measuring Effectiveness:

  1. Does the Suggestion Card result in more people using Search Inside?
    • Check stats for Search Inside page to see if there in a jump in traffic after deployment
  2. Are people using the Suggestion Card?

Technical

In order to test the card, I added a json of sample data to conf
I then referenced the sample data in lending.py.

I 'uploaded' books through the command line by running these commands:
docker compose exec -e PYTHONPATH=. web bash
./scripts/copydocs.py /books/OL32090209M
./scripts/copydocs.py /books/OL24375865M
./scripts/copydocs.py /books/OL24204364M

I did not commit the json of sample data or the addition to lending.py.

Testing

Happy case:

  • Type in a search to the search bar under 'Books' that will likely return 0 results eg 'a cricket in the night' -> Search Inside suggestions will appear
  • Repeat the search in authors, subjects and lists categories -> Search Inside suggestions will appear

Edge case:

  • Type in a complete gibberish search in books, authors, search inside, subjects and lists categories -> Consistent 'No results' message will appear, no Search Inside suggestions

Screenshot

Happy case: A loading indicator will appear beneath 'No results found', and then will be replaced with this card:
Screenshot 2024-07-18 at 4 08 23 PM

Edge case: If there are no Search Inside matches, only the 'No results' message will appear
Screenshot 2024-07-18 at 4 11 15 PM

Stakeholders

@jimchamp @mekarpeles @cdrini

@merwhite11 merwhite11 marked this pull request as draft May 24, 2024 00:54
@merwhite11 merwhite11 force-pushed the 1001/feature/fulltext-search-box branch 5 times, most recently from 12fffd3 to 77d804d Compare May 31, 2024 16:56
@merwhite11 merwhite11 force-pushed the 1001/feature/fulltext-search-box branch 10 times, most recently from 7c3d4e5 to 54773d1 Compare June 7, 2024 20:19
@merwhite11 merwhite11 force-pushed the 1001/feature/fulltext-search-box branch 2 times, most recently from 64b4c75 to ce95cc4 Compare June 10, 2024 20:47
@merwhite11 merwhite11 force-pushed the 1001/feature/fulltext-search-box branch 10 times, most recently from 53d9448 to 9d370ad Compare June 20, 2024 18:54
@merwhite11 merwhite11 marked this pull request as ready for review June 20, 2024 19:18
@merwhite11 merwhite11 changed the title TESTING: Created a Fulltext Suggestion Macro for 0 Results Created a Fulltext Suggestion Macro for 0 Results Jun 20, 2024
@merwhite11 merwhite11 force-pushed the 1001/feature/fulltext-search-box branch from d34e71e to d952364 Compare August 12, 2024 20:54
@merwhite11 merwhite11 closed this Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
On testing.openlibrary.org This PR has been deployed to testing.openlibrary.org for testing Priority: 2 Important, as time permits. [managed]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve Search Results Experience when 0 results
4 participants