class ResponseParser in Search API Solr 4.x
Same name and namespace in other branches
- 8.3 src/Solarium/Autocomplete/ResponseParser.php \Drupal\search_api_solr\Solarium\Autocomplete\ResponseParser
- 8 src/Solarium/Autocomplete/ResponseParser.php \Drupal\search_api_solr\Solarium\Autocomplete\ResponseParser
- 8.2 src/Solarium/Autocomplete/ResponseParser.php \Drupal\search_api_solr\Solarium\Autocomplete\ResponseParser
Autocomplete response parser.
Hierarchy
- class \Drupal\search_api_solr\Solarium\Autocomplete\ResponseParser extends \Solarium\Core\Query\AbstractResponseParser implements \Solarium\Core\Query\ResponseParserInterface
Expanded class hierarchy of ResponseParser
File
- src/
Solarium/ Autocomplete/ ResponseParser.php, line 12
Namespace
Drupal\search_api_solr\Solarium\AutocompleteView source
class ResponseParser extends AbstractResponseParser implements ResponseParserInterface {
/**
* {@inheritdoc}
*/
public function parse(ResultInterface $result) : array {
$data = $result
->getData();
/** @var Query $query */
$query = $result
->getQuery();
$components = [];
foreach ($query
->getComponents() as $component) {
$componentParser = $component
->getResponseParser();
if ($componentParser) {
$components[$component
->getType()] = $componentParser
->parse($query, $component, $data);
}
}
return $this
->addHeaderInfo($data, [
'components' => $components,
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ResponseParser:: |
public | function |