I have been going through the docs and source code looking for something without luck.
Is there a Drupal 6 hook that gets called after hook_search(), but before the $results gets handed off to the template system?
I need to do a fairly custom pruning and reordering of results that get returned. I could just reimplement hook_search(), but this seems like overkill.
Thanks.
Hook search_execute allows you to modify the query in the way you needed. You can even fire new queries with custom sql, for example:
You can use
hook_search_page()
to reorder or format the search result.There isn't;
search_view()
(which displays the results) callssearch_data()
, which invokeshook_search()
then immediately themes the results. Re-implementinghook_search()
is probably the most straightforward route.With that said, you could instead implement
hook_menu_alter()
and have the search page call your custom function instead of callingsearch_view()
(and subsequently callingsearch_data()
). Something like: