You are here

function search_api_solr_update_helper_get_index_third_party_settings in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 search_api_solr.install \search_api_solr_update_helper_get_index_third_party_settings()
  2. 4.x search_api_solr.install \search_api_solr_update_helper_get_index_third_party_settings()

Gets all index third party settings for active Solr servers.

Parameters

string $pattern:

Return value

array All backend configs for active Solr servers keyed by server name.

2 calls to search_api_solr_update_helper_get_index_third_party_settings()
search_api_solr_update_8212 in ./search_api_solr.install
Configure highlighter individually per index and remove global config.
search_api_solr_update_8213 in ./search_api_solr.install
Configure index prefixes individually per server and index.

File

./search_api_solr.install, line 184

Code

function search_api_solr_update_helper_get_index_third_party_settings($pattern = 'solr') {
  $config_factory = \Drupal::configFactory();
  $index_third_party_settings = [];
  foreach ($config_factory
    ->listAll('search_api.index.') as $index_id) {
    $index = $config_factory
      ->get($index_id);
    $backend_configs = search_api_solr_update_helper_get_backend_configs($pattern);
    if (isset($backend_configs[$index
      ->get('server')])) {

      // This index belongs to a Solr server.
      $index_third_party_settings[$index_id] = $index
        ->get('third_party_settings.search_api_solr');
    }
  }
  return $index_third_party_settings;
}