public function RequestBuilder::build in Search API Solr 8
Same name and namespace in other branches
- 8.3 src/Solarium/Autocomplete/RequestBuilder.php \Drupal\search_api_solr\Solarium\Autocomplete\RequestBuilder::build()
- 8.2 src/Solarium/Autocomplete/RequestBuilder.php \Drupal\search_api_solr\Solarium\Autocomplete\RequestBuilder::build()
- 4.x src/Solarium/Autocomplete/RequestBuilder.php \Drupal\search_api_solr\Solarium\Autocomplete\RequestBuilder::build()
Build request for an autocomplete query.
Parameters
\Solarium\Core\Query\AbstractQuery $query: The Solarium query.
Return value
\Solarium\Core\Client\Request The Solarium request.
File
- src/
Solarium/ Autocomplete/ RequestBuilder.php, line 23
Class
- RequestBuilder
- Autocomplete request builder.
Namespace
Drupal\search_api_solr\Solarium\AutocompleteCode
public function build(AbstractQuery $query) : Request {
/** @var \Drupal\search_api_solr\Solarium\Autocomplete\Query $query */
$request = parent::build($query);
foreach ($query
->getComponents() as $component) {
$componentBuilder = $component
->getRequestBuilder();
if ($componentBuilder) {
$request = $componentBuilder
->buildComponent($component, $request);
}
}
return $request;
}