function SearchQueryAlterHooks::querySearchNodeSearchAlter

Implements hook_query_TAG_alter().

Tags search_$type with $type node_search.

File

core/modules/search/tests/modules/search_query_alter/src/Hook/SearchQueryAlterHooks.php, line 20

Class

SearchQueryAlterHooks
Hook implementations for search_query_alter.

Namespace

Drupal\search_query_alter\Hook

Code

public function querySearchNodeSearchAlter(AlterableInterface $query) {
    // For testing purposes, restrict the query to node type 'article' only.
    $query->condition('n.type', 'article');
}

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