-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Open
merwhite11
wants to merge
49
commits into
internetarchive:master
Choose a base branch
from
merwhite11:1001/feature/fulltext-search-box
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Created a Fulltext Suggestion Macro for 0 Results #9332
merwhite11
wants to merge
49
commits into
internetarchive:master
from
merwhite11:1001/feature/fulltext-search-box
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
merwhite11
force-pushed
the
1001/feature/fulltext-search-box
branch
5 times, most recently
from
May 31, 2024 16:56
12fffd3
to
77d804d
Compare
merwhite11
force-pushed
the
1001/feature/fulltext-search-box
branch
10 times, most recently
from
June 7, 2024 20:19
7c3d4e5
to
54773d1
Compare
merwhite11
force-pushed
the
1001/feature/fulltext-search-box
branch
2 times, most recently
from
June 10, 2024 20:47
64b4c75
to
ce95cc4
Compare
merwhite11
force-pushed
the
1001/feature/fulltext-search-box
branch
10 times, most recently
from
June 20, 2024 18:54
53d9448
to
9d370ad
Compare
merwhite11
changed the title
TESTING: Created a Fulltext Suggestion Macro for 0 Results
Created a Fulltext Suggestion Macro for 0 Results
Jun 20, 2024
for more information, see https://pre-commit.ci
merwhite11
force-pushed
the
1001/feature/fulltext-search-box
branch
from
June 28, 2024 16:43
6c569da
to
04f1db6
Compare
merwhite11
force-pushed
the
1001/feature/fulltext-search-box
branch
from
June 28, 2024 16:59
f60eb64
to
4ae75ad
Compare
for more information, see https://pre-commit.ci
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Technical
In order to test the card, I hardcoded data directly into fulltext.py and 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 took these hardcodings out so that it can be tested against the actual database.
Testing
Type in a search to the search bar that will likely return 0 results eg 'a cricket in the night'
Screenshot
A loading indicator will appear beneath 'No results found', and then will be replaced with this card:
Design Notes
The design for the card is not finalized. An alternative version has the link to 'All Search Inside Results' as the header and no footer:
Stakeholders
@jimchamp @mekarpeles @cdrini