API Navigation

Search interface

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:

Specifically for searching nodes, you can implement
hook_node_update_index() and hook_node_search_result(). However, note that
the search system already indexes all visible output of a node; i.e.,
everything displayed normally by hook_view() and hook_node_view(). This is
usually sufficient. You should only use this mechanism if you want
additional, non-visible data to be indexed.

Implement hook_search_info(). This will create a search tab for your module
on the /search page with a simple keyword search form. You will also need
to implement hook_search_execute() to perform the search.

If your module needs to provide a more complicated search form, then you need
to implement it yourself without hook_search_info(). 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.