You are here

protected function AbstractSearchApiSolrMultilingualBackend::getAutocompleteFields in Search API Multilingual Solr Search 8

File

src/Plugin/search_api/backend/AbstractSearchApiSolrMultilingualBackend.php, line 561

Class

AbstractSearchApiSolrMultilingualBackend
A abstract base class for all multilingual Solr Search API backends.

Namespace

Drupal\search_api_solr_multilingual\Plugin\search_api\backend

Code

protected function getAutocompleteFields(QueryInterface $query, SearchInterface $search) {
  $fl = [];
  $solr_field_names = $this
    ->getSolrFieldNames($query
    ->getIndex());
  foreach ($query
    ->getLanguages() as $langcode) {
    $fulltext_fields = $search
      ->getOption('fields') ? $search
      ->getOption('fields') : $this
      ->getQueryFulltextFields($query);
    $language_specific_fulltext_fields = $this
      ->getLanguageSpecificSolrFieldNames($langcode, $solr_field_names, $query
      ->getIndex());
    foreach ($fulltext_fields as $fulltext_field) {
      $fl[] = 'terms_' . $language_specific_fulltext_fields[$fulltext_field];
    }
  }
  return $fl;
}