Same name and namespace in other branches
  1. 4.7.x modules/search.module \search_data()
  2. 5.x modules/search/search.module \search_data()
  3. 6.x modules/search/search.module \search_data()
  4. 7.x modules/search/search.module \search_data()

Perform a standard search on the given keys, and return the formatted results.

Related topics

1 call to search_data()
search_view in modules/search.module
Menu callback; presents the search form and/or search results.

File

modules/search.module, line 677
Enables site-wide keyword searching.

Code

function search_data($keys = NULL, $type = 'node') {
  $output = '';
  if (isset($keys)) {
    if (module_hook($type, 'search')) {
      $results = module_invoke($type, 'search', 'search', $keys);
      if (is_array($results) && count($results)) {
        $output .= '<dl class="search-results">';
        foreach ($results as $entry) {
          $output .= theme('search_item', $entry, $type);
        }
        $output .= '</dl>';
        $output .= theme('pager', NULL, 15, 0);
      }
    }
  }
  return $output;
}