How do I direct users to my custom search? I'm trying to use hook_search_execute to run a custom search inside my module:

function mymodule_search_execute($keys = NULL, $conditions = NULL) {
    die; // just to see if we get called
    // lots of lines copied from the hook_search_execute doco
    return $results;
}


I can get the default Drupal search form inside my page.tpl.php with:

&lt;?php print render(module_invoke('search', 'block_view', 'search')); ?&gt;


But, when I click the "search" button on that form, my custom search isn't called.

I'm using D7. What's the appropriate way to actually force a search to get results from my custom search function?
I would use hook_form_alter() to alter the default search form to call your own submit function.

So, in your custom module do something like this:

// Alter regular search box
function YOURMODULENAME_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if($form["#id"] == 'search-block-form') {
    // Add any additional fields or things you need here

    ...

    // Modify the submit handler that is called
    $form['#submit'] = array('YOUR_CUSTOM_search_submit');
  }
}


This actually modifies precisely that block search form, so including the search block just like you've described in the template file should work once you've implemented the form alter.