The Drupal search interface manages a global search mechanism.
Modules may plug into this system to provide searches of different types of data. Most of the system is handled by search.module, so this must be enabled for all of the search features to work.
There are three ways to interact with the search system:
| Name | Location | Description |
|---|---|---|
| do_search | drupal/modules/search/search.module | Do a query on the full-text search index for a word or words. |
| hook_search | contributions/docs/developer/hooks/core.php | Define a custom search routine. |
| hook_update_index | contributions/docs/developer/hooks/core.php | Update Drupal's full-text index for this module. |
| search_box | drupal/modules/search/search.module | Form builder; Output a search form for the search block and the theme's search box. |
| search_box_form_submit | drupal/modules/search/search.module | Process a block search form submission. |
| search_data | drupal/modules/search/search.module | Perform a standard search on the given keys, and return the formatted results. |
| search_excerpt | drupal/modules/search/search.module | Returns snippets from a piece of text, with certain keywords highlighted. Used for formatting search results. |
| search_form | drupal/modules/search/search.module | Render a search form. |
| search_index | drupal/modules/search/search.module | Update the full-text search index for a particular item. |
| template_preprocess_search_block_form | drupal/modules/search/search.module | Process variables for search-block-form.tpl.php. |
| template_preprocess_search_theme_form | drupal/modules/search/search.module | Process variables for search-theme-form.tpl.php. |