You are here

protected function SearchApiSolrAcquiaConnector::setReadOnlyMode in Acquia Search 3.x

Same name and namespace in other branches
  1. 2.x src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php \Drupal\acquia_search\Plugin\SolrConnector\SearchApiSolrAcquiaConnector::setReadOnlyMode()

Sets read-only mode to the given Solr config.

We enforce read-only mode in 2 ways:

  • The module implements hook_search_api_index_load() and alters indexes'

read-only flag.

  • In this plugin, we "emulate" read-only mode by overriding

$this->getUpdateQuery() and avoiding all updates just in case something is still attempting to directly call a Solr update.

Parameters

array $configuration: Solr connection configuration.

Return value

array Updated Solr connection configuration.

File

src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php, line 175

Class

SearchApiSolrAcquiaConnector
Class SearchApiSolrAcquiaConnector.

Namespace

Drupal\acquia_search\Plugin\SolrConnector

Code

protected function setReadOnlyMode(array $configuration) : array {
  $configuration['overridden_by_acquia_search'] = SearchApiSolrAcquiaConnector::READ_ONLY;
  return $configuration;
}