As far as I can tell, there are two things wrong with the hilite plugin when using the WordPress search.
1. It gives the referer precedence over the current url’s query string. I would recommend we change the logic in get_search_query_terms() to
case ‘wordpress’:
// Check the search form vars if the search terms
// aren’t in the referer. Do this first, ignore the
// referer if we can!
if (isset($s_array) and sizeof($s_array) > 0 ) {
$query_array = $s_array;
break;
} else if (isset($s) and $s) {
$query_array = array($s);
break;
}
…
2. The search behaviour when matching a single post doesn’t play well with the plugin. If we match a single post, you are redirected from the search you were trying to do, onto the single post page. Your referer is the page where you initiated the search (which might have an old search term in it) , and your query string has no search terms. If you put the query string s=blah back into the url, it will bounce you back to one without it.
Some examples:
Start on /index.php, search ‘uncommon’ /index.php?s=uncommon, bounced to one page /index.php?p=1 with referer=/index.php your start page.
Start on /index.php?s=common (just finished a search for a common word), search ‘uncommon’ /index.php?s=uncommon, bounced to one page /index.php?p=1 with referer=/index.php?s=common (your start page), so it will hilite the ‘common’ word on this page, even though you were searching for uncommon.