search_data

  1. drupal
    1. 5
    2. 6
    3. 7
    4. 8
Versions
5 – 6 search_data($keys = NULL, $type = 'node')
8 – 7 search_data($keys, $module, $conditions = NULL)

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

Related topics

▾ 3 functions call search_data()

node_admin_search in modules/node/node.module
search_view in modules/search/search.module
Menu callback; presents the search form and/or search results.
user_admin in modules/user/user.module

Code

modules/search/search.module, line 1085

<?php
function search_data($keys = NULL, $type = 'node') {

  if (isset($keys)) {
    if (module_hook($type, 'search')) {
      $results = module_invoke($type, 'search', 'search', $keys);
      if (isset($results) && is_array($results) && count($results)) {
        if (module_hook($type, 'search_page')) {
          return module_invoke($type, 'search_page', $results);
        }
        else {
          return theme('search_page', $results, $type);
        }
      }
    }
  }
}
?>