search_data

5 search.module search_data($keys = NULL, $type = 'node')
6 search.module search_data($keys = NULL, $type = 'node')
7 search.module search_data($keys, $module, $conditions = NULL)
8 search.module search_data($keys, $module, $conditions = NULL)

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

Related topics

1 call to search_data()

File

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

Code

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_results', $results, $type);
        }
      }
    }
  }
}

Comments

hook_search_page is undocumented

Be aware, the hook_search_page($results) is undocumented. It provides your module an opportunity to theme your search results. There is no implementation of the hook in Drupal core.

Note: hook_search_page() is a

Note: hook_search_page() is a Drupal 7/8 feature.

HIghlight searched keyword in result displayed

Hi All,

How I can highlight keywords, in result displayed?

Thank You

search_excerpt

Login or register to post comments