function SearchNode::getRankings

Same name and namespace in other branches
  1. 11.x core/modules/search/modules/search_node/src/Plugin/Search/SearchNode.php \Drupal\search_node\Plugin\Search\SearchNode::getRankings()

Gathers ranking definitions from hook_node_search_ranking().

Return value

array An array of ranking definitions.

3 calls to SearchNode::getRankings()
SearchNode::addNodeRankings in core/modules/search/modules/search_node/src/Plugin/Search/SearchNode.php
Adds the configured rankings to the search query.
SearchNode::buildConfigurationForm in core/modules/search/modules/search_node/src/Plugin/Search/SearchNode.php
Form constructor.
SearchNode::submitConfigurationForm in core/modules/search/modules/search_node/src/Plugin/Search/SearchNode.php
Form submission handler.

File

core/modules/search/modules/search_node/src/Plugin/Search/SearchNode.php, line 728

Class

SearchNode
Handles searching for node entities using the Search module index.

Namespace

Drupal\search_node\Plugin\Search

Code

protected function getRankings() {
  if (!$this->rankings) {
    $this->rankings = $this->moduleHandler
      ->invokeAll('node_search_ranking');
  }
  return $this->rankings;
}

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