function SearchPluginBase::getHelp

Same name in other branches
  1. 9 core/modules/search/src/Plugin/SearchPluginBase.php \Drupal\search\Plugin\SearchPluginBase::getHelp()
  2. 10 core/modules/search/src/Plugin/SearchPluginBase.php \Drupal\search\Plugin\SearchPluginBase::getHelp()
  3. 11.x core/modules/search/src/Plugin/SearchPluginBase.php \Drupal\search\Plugin\SearchPluginBase::getHelp()

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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.