[PR #1130] [MERGED] Fix feeling lucky #1086

Closed
opened 2026-02-25 20:37:37 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/benbusby/whoogle-search/pull/1130
Author: @pantherman594
Created: 3/22/2024
Status: Merged
Merged: 4/19/2024
Merged by: @benbusby

Base: mainHead: bug/feeling_lucky


📝 Commits (3)

  • 6f61aa0 Fix feeling lucky, fall through to display results if doesn't work
  • 453b72d Allow lucky bang anywhere
  • 9de34d2 Update feeling lucky test

📊 Changes

3 files changed (+54 additions, -24 deletions)

View changed files

📝 app/utils/results.py (+17 -3)
📝 app/utils/search.py (+29 -20)
📝 test/test_routes.py (+8 -1)

📄 Description

Feeling lucky (a search query with a standalone bang) was returning 404 because it was trying to redirect to the maps link. This PR runs the result cleaning first to get the results in a consistent state and apply any URL rewriting, and excludes internal links from the results. It also skips past any details sections because those links are probably not the ones a user would be looking for. Finally, I let the feeling lucky fall back to return normal search results, in case something went wrong looking for a link.

Test was updated to verify that the correct redirection link was found.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/benbusby/whoogle-search/pull/1130 **Author:** [@pantherman594](https://github.com/pantherman594) **Created:** 3/22/2024 **Status:** ✅ Merged **Merged:** 4/19/2024 **Merged by:** [@benbusby](https://github.com/benbusby) **Base:** `main` ← **Head:** `bug/feeling_lucky` --- ### 📝 Commits (3) - [`6f61aa0`](https://github.com/benbusby/whoogle-search/commit/6f61aa087103c589814fb39d62bf091993863692) Fix feeling lucky, fall through to display results if doesn't work - [`453b72d`](https://github.com/benbusby/whoogle-search/commit/453b72d8573d236ce3fce29be8da699002bb353a) Allow lucky bang anywhere - [`9de34d2`](https://github.com/benbusby/whoogle-search/commit/9de34d2681aa0df7bbad01a1a7e94ba073b3a4c3) Update feeling lucky test ### 📊 Changes **3 files changed** (+54 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `app/utils/results.py` (+17 -3) 📝 `app/utils/search.py` (+29 -20) 📝 `test/test_routes.py` (+8 -1) </details> ### 📄 Description Feeling lucky (a search query with a standalone bang) was returning 404 because it was trying to redirect to the maps link. This PR runs the result cleaning first to get the results in a consistent state and apply any URL rewriting, and excludes internal links from the results. It also skips past any details sections because those links are probably not the ones a user would be looking for. Finally, I let the feeling lucky fall back to return normal search results, in case something went wrong looking for a link. Test was updated to verify that the correct redirection link was found. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 20:37:37 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/whoogle-search#1086
No description provided.