You are here

public function SearchApiSolrBackend::setConfiguration in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::setConfiguration()
  2. 8 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::setConfiguration()
  3. 8.2 src/Plugin/search_api/backend/SearchApiSolrBackend.php \Drupal\search_api_solr\Plugin\search_api\backend\SearchApiSolrBackend::setConfiguration()

File

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

Class

SearchApiSolrBackend
Apache Solr backend for search api.

Namespace

Drupal\search_api_solr\Plugin\search_api\backend

Code

public function setConfiguration(array $configuration) {
  $configuration['retrieve_data'] = (bool) $configuration['retrieve_data'];
  $configuration['highlight_data'] = (bool) $configuration['highlight_data'];
  $configuration['site_hash'] = (bool) $configuration['site_hash'];
  $configuration['optimize'] = (bool) $configuration['optimize'];
  $configuration['fallback_multiple'] = (bool) $configuration['fallback_multiple'];
  $configuration['rows'] = (int) ($configuration['rows'] ?? 10);
  $configuration['index_single_documents_fallback_count'] = (int) ($configuration['index_single_documents_fallback_count'] ?? 10);
  parent::setConfiguration($configuration);

  // Update the configuration of the Solr connector as well by replacing it by
  // a new instance with the latest configuration.
  $this->solrConnector = NULL;
}