class Result in Search API Solr 4.x
Same name and namespace in other branches
- 8.3 src/Solarium/Autocomplete/Result.php \Drupal\search_api_solr\Solarium\Autocomplete\Result
- 8 src/Solarium/Autocomplete/Result.php \Drupal\search_api_solr\Solarium\Autocomplete\Result
- 8.2 src/Solarium/Autocomplete/Result.php \Drupal\search_api_solr\Solarium\Autocomplete\Result
Autocomplete query result.
Hierarchy
- class \Drupal\search_api_solr\Solarium\Autocomplete\Result extends \Solarium\Core\Query\Result\QueryType
Expanded class hierarchy of Result
File
- src/
Solarium/ Autocomplete/ Result.php, line 11
Namespace
Drupal\search_api_solr\Solarium\AutocompleteView source
class Result extends BaseResult {
/**
* Component results.
*
* @var array
*/
protected $components;
/**
* Get all component results.
*
* @return array
* The component results.
*/
public function getComponents() {
$this
->parseResponse();
return $this->components;
}
/**
* Get a component result by key.
*
* @param string $key
* The component key.
*
* @return mixed
* The component value.
*/
public function getComponent($key) {
$this
->parseResponse();
if (isset($this->components[$key])) {
return $this->components[$key];
}
return NULL;
}
/**
* Get spellcheck component result.
*
* This is a convenience method that maps presets to getComponent.
*
* @return \Solarium\Component\Result\Spellcheck\Result|null
* The spellcheck component result.
*/
public function getSpellcheck() {
return $this
->getComponent(ComponentAwareQueryInterface::COMPONENT_SPELLCHECK);
}
/**
* Get suggester component result.
*
* This is a convenience method that maps presets to getComponent.
*
* @return \Solarium\Component\Result\Suggester\Result|null
* The suggester component result.
*/
public function getSuggester() {
return $this
->getComponent(ComponentAwareQueryInterface::COMPONENT_SUGGESTER);
}
/**
* Get terms component result.
*
* This is a convenience method that maps presets to getComponent.
*
* @return \Solarium\Component\Result\Terms\Result|null
* The terms component result.
*/
public function getTerms() {
return $this
->getComponent(ComponentAwareQueryInterface::COMPONENT_TERMS);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Result:: |
protected | property | Component results. | |
Result:: |
public | function | Get a component result by key. | |
Result:: |
public | function | Get all component results. | |
Result:: |
public | function | Get spellcheck component result. | |
Result:: |
public | function | Get suggester component result. | |
Result:: |
public | function | Get terms component result. |