You are here

public function Result::getComponent in Search API Solr 8.3

Same name and namespace in other branches
  1. 8 src/Solarium/Autocomplete/Result.php \Drupal\search_api_solr\Solarium\Autocomplete\Result::getComponent()
  2. 8.2 src/Solarium/Autocomplete/Result.php \Drupal\search_api_solr\Solarium\Autocomplete\Result::getComponent()
  3. 4.x src/Solarium/Autocomplete/Result.php \Drupal\search_api_solr\Solarium\Autocomplete\Result::getComponent()

Get a component result by key.

Parameters

string $key: The component key.

Return value

mixed The component value.

3 calls to Result::getComponent()
Result::getSpellcheck in src/Solarium/Autocomplete/Result.php
Get spellcheck component result.
Result::getSuggester in src/Solarium/Autocomplete/Result.php
Get suggester component result.
Result::getTerms in src/Solarium/Autocomplete/Result.php
Get terms component result.

File

src/Solarium/Autocomplete/Result.php, line 41

Class

Result
Autocomplete query result.

Namespace

Drupal\search_api_solr\Solarium\Autocomplete

Code

public function getComponent($key) {
  $this
    ->parseResponse();
  if (isset($this->components[$key])) {
    return $this->components[$key];
  }
  return NULL;
}