You are here

public function SolrConnectorPluginBase::autocomplete in Search API Solr 8

Same name and namespace in other branches
  1. 4.x src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::autocomplete()

File

src/SolrConnector/SolrConnectorPluginBase.php, line 813

Class

SolrConnectorPluginBase
Defines a base class for Solr connector plugins.

Namespace

Drupal\search_api_solr\SolrConnector

Code

public function autocomplete(AutocompleteQuery $query, ?Endpoint $endpoint = NULL) {
  $this
    ->connect();
  if (!$endpoint) {
    $endpoint = $this->solr
      ->getEndpoint();
  }
  $this
    ->useTimeout(self::QUERY_TIMEOUT, $endpoint);

  // Use the 'postbigrequest' plugin if no specific http method is
  // configured. The plugin needs to be loaded before the request is
  // created.
  if ($this->configuration['http_method'] === 'AUTO') {
    $this->solr
      ->getPlugin('postbigrequest');
  }
  return $this
    ->execute($query, $endpoint);
}