Changing the number of search results per page with the core search module What is the best way to change the number of search results per page when using the core search module?

I have both Drupal 6 and 7 sites that I would like to do this with.

In Drupal 6, the value 10 is hardcoded in  do_search().

In Drupal 7, the value 10 is hardcoded in the hooks, eg node_search_execute(), and there isn't a tag added that can uniquely identify the query for altering.  The idea has been floated in the issue queue, but as of 2013-01-30, nothing has been committed yet.

In the past I have hacked core and handled upgrades with patch management using the normal methods.
Overriding the hook implemented from the Node module is not possible because hook_search_execute() is invoked by search_data() using the following code.

  if (module_hook($module, 'search_execute')) {
    $results = module_invoke($module, 'search_execute', $keys, $conditions);
    if (module_hook($module, 'search_page')) {
      return module_invoke($module, 'search_page', $results);
    }
    else {
      return array(
        '#theme' =&gt; 'search_results', 
        '#results' =&gt; $results, 
        '#module' =&gt; $module,
      );
    }
  }


$module is the parameter passed to search_data(). hook_search_execute() is similarly to hook_form() which is invoked for the module implementing the content type, not for every module.

I was looking for a way to alter the query executed to search nodes, and the only way I found is to alter the page callback for search/node. That is the way that requires less code.  Otherwise, the only alternative I can think of is implementing a search module to replace the search tab implemented for the Node module.

Since Drupal uses hook_search_info(), but doesn't uses hook_search_info_alter(), and hook_search_info() doesn't return much useful data (at least to help overriding the search query), I think there aren't other alternatives.