In the scenario when you want to force people to the cloest matching page instead of showing them a list of hits, a notification will popup on the final destiation (a system message) notifying the visitor that this is where the automatic seach directed them, based on keywords a, b, c.

I thought it would be nicer if we gave the visitor an option to see those other results, in case the content they were looking for was more ambigious, and/or was not in fact, the page they landed on at all (it happens!).

So here is a super quick suggestion/tweak I am now using in the .module file, around line 180:

if (!variable_get('search404_disable_error_message', FALSE)) {
            //drupal_set_message(t('The page you requested does not exist. A search for %keys resulted in this page.', array('%keys' => check_plain($keys))), 'status');
              drupal_set_message(t('The page you requested has moved. Not quite what you were looking for? <a href="/search/node/'.check_plain($keys).'">Other results</a>.'), 'status');
            }

This gives the visitor the option to immediately perform a keyword search using the same terms search404 used, but lets them see and pick from the results.

I think it's a good approach for major website migrations (like html to Drupal), where you don't want people to be stuck getting 404s or hunting through lists of results, but are not 100% confident that the first match is what they want.

CommentFileSizeAuthor
#2 more_useful-2263281-2.patch2.46 KBarjun_sreekumar

Comments

arjun_sreekumar’s picture

Assigned: Unassigned » arjun_sreekumar
Status: Needs review » Needs work
arjun_sreekumar’s picture

Status: Needs work » Needs review
StatusFileSize
new2.46 KB
anish.a’s picture

Version: 7.x-1.3 » 7.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

Patch looks good. Can be merged.

anish_zyxware’s picture

Status: Reviewed & tested by the community » Closed (fixed)