You are here

protected function SearchApiSolrBackend::addDefaultConfigurationForConfigGeneration 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::addDefaultConfigurationForConfigGeneration()

Add the default configuration for config-set generation.

DefaultConfiguration() is called on any search. Loading the defaults only required for config-set generation is an overhead that isn't required.

4 calls to SearchApiSolrBackend::addDefaultConfigurationForConfigGeneration()
SearchApiSolrBackend::getDisabledCaches in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Gets a list of Solr Caches that are disabled for this backend.
SearchApiSolrBackend::getDisabledFieldTypes in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Gets a list of Solr Field Types that are disabled for this backend.
SearchApiSolrBackend::getDisabledRequestDispatchers in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Gets a list of Solr Request Dispatchers that are disabled for this backend.
SearchApiSolrBackend::getDisabledRequestHandlers in src/Plugin/search_api/backend/SearchApiSolrBackend.php
Gets a list of Solr Request Handlers that are disabled for this backend.

File

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

Class

SearchApiSolrBackend
Apache Solr backend for search api.

Namespace

Drupal\search_api_solr\Plugin\search_api\backend

Code

protected function addDefaultConfigurationForConfigGeneration() {
  if (!isset($this->configuration['disabled_field_types'])) {

    /** @var \Drupal\search_api_solr\Controller\AbstractSolrEntityListBuilder $solr_field_type_list_builder */
    $solr_field_type_list_builder = $this->entityTypeManager
      ->getListBuilder('solr_field_type');
    $this->configuration['disabled_field_types'] = array_keys($solr_field_type_list_builder
      ->getAllNotRecommendedEntities());
  }
  if (!isset($this->configuration['disabled_caches'])) {

    /** @var \Drupal\search_api_solr\Controller\AbstractSolrEntityListBuilder $solr_cache_list_builder */
    $solr_cache_list_builder = $this->entityTypeManager
      ->getListBuilder('solr_cache');
    $this->configuration['disabled_caches'] = array_keys($solr_cache_list_builder
      ->getAllNotRecommendedEntities());
  }
  if (!isset($this->configuration['disabled_request_handlers'])) {

    /** @var \Drupal\search_api_solr\Controller\AbstractSolrEntityListBuilder $solr_request_handler_list_builder */
    $solr_request_handler_list_builder = $this->entityTypeManager
      ->getListBuilder('solr_request_handler');
    $this->configuration['disabled_request_handlers'] = array_keys($solr_request_handler_list_builder
      ->getAllNotRecommendedEntities());
  }
  if (!isset($this->configuration['disabled_request_dispatchers'])) {

    /** @var \Drupal\search_api_solr\Controller\AbstractSolrEntityListBuilder $solr_request_dispatcher_list_builder */
    $solr_request_dispatcher_list_builder = $this->entityTypeManager
      ->getListBuilder('solr_request_dispatcher');
    $this->configuration['disabled_request_dispatchers'] = array_keys($solr_request_dispatcher_list_builder
      ->getAllNotRecommendedEntities());
  }
}