Documentation Level: 
Introduction
Documentation Status: 
No known problems

The Search module lets users search for specific content on your site via the URL example.com/search. You can search both for users and for particular words.

Search Bar

When you are on the content tab of Search, you will be able to search for words appearing in the default rendering of node content on your site, which would include any fields, Taxonomy, etc., as well as comments. When you are on the Users tab of Search, you will be able to search the usernames of registered users on your site, and if you have sufficient permissions, also their email addresses.

Note that by default; content search only finds exact matches for the keywords in your content. 

Search Query Types

Search queries can be done in a variety of ways. Backdrop's search allows the user create a very powerful search by adding a few key words or symbols.

  • AND Searches - to get results that match multiple words, simply type the words that you want to find. This is the default behavior of Backdrop's search.
  • OR Searches - to search for data that may contain one of a few terms, but not necessarily all of the terms, enter the keyword OR between each search term: "dogs OR cats" or "dogs OR cats OR birds." Note: The keyword "OR" must be capitalized. The search module will treat the lowercase "or" as another word to find. Because "or" is smaller than the default search word length (3 characters), the search module will ignore "or" to create an "AND" search instead.
  • Exclusionary Searches - you can even filter for things that don't exist. For example, if you want to find pet stores that do not have chickens, you need an exclusionary search. Backdrop allows you to do this using the minus "-" sign. For example "pet stores -chickens" finds all nodes with "pet" and "stores that do not also contain the words "chickens."

Advanced Search

With Advanced Search you can also look for "any of these words" or "this phrase," or both. You can rule out words you don't want, and you can choose content types within which to confine your search.

Advanced Search

Indexing

Backdrop's search engine indexes the text content of the nodes on your site. You can modify the way this is done.

The search engine indexes at Cron (which stands for chronograph) intervals. For further guidance on cron, refer to Backdrop's handbook page on Cron settings. Your hosting company may also help guide you.

On your search setting page at Admin > Search configuration > Search and metadata  Search settings you can limit how many items should be indexed in a single cron run. This can help keep your system from getting overloaded with work. (If you get a message that cron is timing out or PHP is running out of memory, lower the number of items to index per run.) You also have a few more search settings you can choose.

Reindexing content

Content-related actions on your site (creating, editing, or deleting content and comments) automatically cause affected content items to be marked for indexing or reindexing at the next cron run. When content is marked for reindexing, the previous content remains in the index until cron runs, at which time it is replaced by the new content.

Unlike content-related actions, actions related to the structure of your site do not cause affected content to be marked for reindexing. Examples of structure-related actions that affect content include deleting or editing taxonomy terms, enabling or disabling modules that add text to content (such as Taxonomy, Comment, and field-providing modules), and modifying the fields or display parameters of your content types. If you take one of these actions and you want to ensure that the search index is updated to reflect your changed site structure, you can mark all content for reindexing by clicking the "Invalidate search index" button on the Search settings page (Configuration > Search and metadata > Search settings).

Accessing Search

You can place a link to Search on your site's Primary navigation menu, or on any other menu as well. (Click "add menu item," and when you fill in the "path" field on the dialogue page just enter "search.")

A search block is also available in Backdrop which can be added to your site in a Layout Manage blocks page.

On your permissions page Admin > User accounts > Permissions you can decide who can do searches and who can administer the search settings. By default, anonymous users cannot perform searches.

A technical note: To use the search module the database user needs the create temporary table permission. If you do not have it, ask your systems administrator to make sure it's granted to you.

 

Source: https://www.drupal.org/documentation/modules/search