public function ResponseParser::parse 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::parse()
- 8 src/Solarium/Autocomplete/ResponseParser.php \Drupal\search_api_solr\Solarium\Autocomplete\ResponseParser::parse()
- 8.2 src/Solarium/Autocomplete/ResponseParser.php \Drupal\search_api_solr\Solarium\Autocomplete\ResponseParser::parse()
File
- src/
Solarium/ Autocomplete/ ResponseParser.php, line 17
Class
- ResponseParser
- Autocomplete response parser.
Namespace
Drupal\search_api_solr\Solarium\AutocompleteCode
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,
]);
}