You are here

public function SearchPluginBase::getHelp in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/search/src/Plugin/SearchPluginBase.php \Drupal\search\Plugin\SearchPluginBase::getHelp()

Returns the searching help.

Return value

array Render array for the searching help.

Overrides SearchInterface::getHelp

1 method overrides SearchPluginBase::getHelp()
UserSearch::getHelp in core/modules/user/src/Plugin/Search/UserSearch.php
Returns the searching help.

File

core/modules/search/src/Plugin/SearchPluginBase.php, line 146

Class

SearchPluginBase
Defines a base class for plugins wishing to support search.

Namespace

Drupal\search\Plugin

Code

public function getHelp() {

  // This default search help is appropriate for plugins like NodeSearch
  // that use the SearchQuery class.
  $help = [
    'list' => [
      '#theme' => 'item_list',
      '#items' => [
        $this
          ->t('Search looks for exact, case-insensitive keywords; keywords shorter than a minimum length are ignored.'),
        $this
          ->t('Use upper-case OR to get more results. Example: cat OR dog (content contains either "cat" or "dog").'),
        $this
          ->t('You can use upper-case AND to require all words, but this is the same as the default behavior. Example: cat AND dog (same as cat dog, content must contain both "cat" and "dog").'),
        $this
          ->t('Use quotes to search for a phrase. Example: "the cat eats mice".'),
        $this
          ->t('You can precede keywords by - to exclude them; you must still have at least one "positive" keyword. Example: cat -dog (content must contain cat and cannot contain dog).'),
      ],
    ],
  ];
  return $help;
}