I have something like this setup on my site. I haven't looked at automatically showing search results, but I do have it generate links for them to click for search.
For instance:
This used to be an album, but when I restructured my directories I needed a way to provide an easy to find navigation for search.
A link to an image and folder that were both moved with search links for both the album and object itself.
Below is the coding I'm using on my 404 page, so I'm sure you can modify it to auto-search if you want, I just never took it that far. It's probably not pretty, or efficient, but it does the job for the most part.
`
<div class="errorbox">
<?php
echo gettext("I'm sorry, the link you clicked appears to lead to something that has been moved, is temporarily offline, is missing, or is broken.");
?>
Please click any of the links below (if any) to search for any realtive pages:
<?php
if (isset($album)) {
echo '
[img]'. $_zp_themeroot . '/images/arrow_right.gif[/img] '.FULLWEBPATH.getSearchURL($album, NULL, NULL, NULL).'';
}
if (isset($image)) {
echo '
[img]'. $_zp_themeroot . '/images/arrow_right.gif[/img] '.FULLWEBPATH.getSearchURL($image, NULL, NULL, NULL).'';
}
if (isset($obj)) {
echo '
[img]'. $_zp_themeroot . '/images/arrow_right.gif[/img] '.FULLWEBPATH.getSearchURL(substr(basename($obj),0,-4), NULL, NULL, NULL).'';
}
?>
</div>
`