In my template.php, I have this function:

function phptemplate_search_page($results, $type) {
	$output = '<table>';
	$output .= '<thead><tr><th>Material Name</th><th>Material Type</th><th>Color(s)</th></tr></thead><tbody>';

  foreach ($results as $entry) {
    $output .= theme('search_item', $entry, $type);
  }
  $output .= '</tbody></table>';
  $output .= theme('pager', NULL, 20, 0);

  return $output;
}

Yet when I do a search, there are only 10 items per page instead of 20. I've enabled/disabled the theme. What else do I need to do to change the number of search result items per page?

Thanks,
Paul

Comments

tormu’s picture

Sounds odd that it can't be done like this or not changed.. I see no error in your code, but I think the problem lies deeper..

In the search.module there's a function do_search() which performs the pager_query, and it does that query with a limit of 10. When the query does it with a limit of 10, you can't theme it to be 20 later. I'm not 100% sure but I guess this is the problem..
Unless they make a new feature to the search module for this limit value to be a settings variable that you can change, I can't think of any clean solution.

pbland’s picture

Thanks for the reply jari. I can't believe I'm the only one who has a problem increasing the amount of search results. I've searched on the Forum and couldn't find any posts so I just assumed I was doing something wrong. Maybe I'm not searching using the correct keywords to find some posts.

---------------------------------------------------------------
My drupal site: Vacation-Places

danieltome’s picture

Curerntyl drupal 5 has it hardocded to 10.
You can check this post here: http://drupal.org/node/166814
It's in search.module line 871

cheers,