You are here

function search_api_solr_update_helper_get_indexes in Search API Solr 8.3

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

Gets all index settings for Solr servers.

Parameters

string $pattern:

Return value

array All index configs for Solr servers keyed by index name.

2 calls to search_api_solr_update_helper_get_indexes()
search_api_solr_update_8308 in ./search_api_solr.install
Configure multilingual features individually per index.
search_api_solr_update_helper_get_index_third_party_settings in ./search_api_solr.install
Gets all index third party settings for Solr servers.

File

./search_api_solr.install, line 381
Install, update and uninstall functions for the Search API Solr module.

Code

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

      // This index belongs to a Solr server.
      $indexes[$index_id] = $index;
    }
  }
  return $indexes;
}