You are here

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

Same name and namespace in other branches
  1. 3.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.

1 call to SearchApiSolrAcquiaConnector::setReadOnlyMode()
SearchApiSolrAcquiaConnector::defaultConfiguration in src/Plugin/SolrConnector/SearchApiSolrAcquiaConnector.php
Gets default configuration for this plugin.

File

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

Class

SearchApiSolrAcquiaConnector
Acquia Search Plugin for Search API Solr.

Namespace

Drupal\acquia_search\Plugin\SolrConnector

Code

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