Contributions API

Search interface

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:

If your module needs to provide a more complicated search form, then you need to implement it yourself without hook_search(). In that case, you should define it as a local task (tab) under the /search page (e.g. /search/mymodule) so that users can easily find it.

Functions

Namesort iconLocationDescription
do_search6/modules/search/search.moduleDo a query on the full-text search index for a word or words.
hook_searchdocumentation/hooks/core.phpDefine a custom search routine.
hook_update_indexdocumentation/hooks/core.phpUpdate Drupal's full-text index for this module.
search_box6/modules/search/search.moduleForm builder; Output a search form for the search block and the theme's search box. See alsosearch_box_form_submit()
search_box_form_submit6/modules/search/search.moduleProcess a block search form submission.
search_data6/modules/search/search.modulePerform a standard search on the given keys, and return the formatted results.
search_excerpt6/modules/search/search.moduleReturns snippets from a piece of text, with certain keywords highlighted. Used for formatting search results.
search_form6/modules/search/search.moduleRender a search form.
search_index6/modules/search/search.moduleUpdate the full-text search index for a particular item.
template_preprocess_search_block_form6/modules/search/search.moduleProcess variables for search-block-form.tpl.php.
template_preprocess_search_theme_form6/modules/search/search.moduleProcess variables for search-theme-form.tpl.php.