You are here

public function SearchService::getResults in Fast Autocomplete 8

Return the results based on the given key.

Parameters

\Drupal\fac\FacConfigInterface $fac_config: The FacConfig entity.

string $langcode: The language code.

string $key: The search key.

Return value

array The results for the given key.

File

src/SearchService.php, line 55

Class

SearchService
Class SearchService.

Namespace

Drupal\fac

Code

public function getResults(FacConfigInterface $fac_config, $langcode, $key) {
  $search_plugin = $this->searchPluginManager
    ->createInstance($fac_config
    ->getSearchPluginId());
  $search_results = $search_plugin
    ->getResults($fac_config, $langcode, $key);
  $results = $this
    ->renderResults($fac_config, $search_results, $langcode);
  return $results;
}