You are here

public function SearchApiSolrBackend::getSolrFieldNamesKeyedByLanguage in Search API Solr 8.3

Same name and namespace in other branches
  1. 4.x src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::getSolrFieldNamesKeyedByLanguage()

Gets a language-specific mapping from Drupal to Solr field names.

Parameters

array $language_ids: The language to get the mapping for.

\Drupal\search_api\IndexInterface $index: The Search API index entity.

bool $reset: (optional) Whether to reset the static cache.

Return value

array The language-specific mapping from Drupal to Solr field names.

Throws

\Drupal\search_api\SearchApiException

Overrides SolrBackendInterface::getSolrFieldNamesKeyedByLanguage

6 calls to SearchApiSolrBackend::getSolrFieldNamesKeyedByLanguage()
SearchApiSolrBackend::createFilterQueries in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Recursively transforms conditions into a flat array of Solr filter queries.
SearchApiSolrBackend::getAutocompleteFields in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Get the fields to search for autocomplete terms.
SearchApiSolrBackend::getMoreLikeThisQuery in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Changes the query to a "More Like This" query.
SearchApiSolrBackend::search in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Options on $query prefixed by 'solr_param_' will be passed natively to Solr as query parameter without the prefix. For example you can set the "Minimum Should Match" parameter 'mm' to '75%' like this:
SearchApiSolrBackend::setFields in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Set the list of fields Solr should return as result.

... See full list

File

src/Plugin/search_api/backend/SearchApiSolrBackend.php, line 2140

Class

SearchApiSolrBackend
Apache Solr backend for search api.

Namespace

Drupal\search_api_solr\Plugin\search_api\backend

Code

public function getSolrFieldNamesKeyedByLanguage(array $language_ids, IndexInterface $index, $reset = FALSE) {
  $field_names = [];
  foreach ($language_ids as $language_id) {
    foreach ($this
      ->getLanguageSpecificSolrFieldNames($language_id, $index, $reset) as $name => $solr_name) {
      $field_names[$name][$language_id] = $solr_name;

      // Just reset once.
      $reset = FALSE;
    }
  }
  return $field_names;
}