You are here

public static function Utility::getSolrCloudConnector in Search API Solr 4.x

Gets the Solr Cloud connector configured for a server.

Parameters

\Drupal\search_api\ServerInterface $server: The Search API Server.

Return value

\Drupal\search_api_solr\SolrCloudConnectorInterface

Throws

\Drupal\search_api\SearchApiException

\Drupal\search_api_solr\SearchApiSolrException

3 calls to Utility::getSolrCloudConnector()
SolrAdminCommandHelper::deleteCollection in modules/search_api_solr_admin/src/Utility/SolrAdminCommandHelper.php
Delete Solr collection.
SolrAdminCommandHelper::uploadConfigset in modules/search_api_solr_admin/src/Utility/SolrAdminCommandHelper.php
Generates and uploads the configset for a Solr search server.
SolrUploadConfigsetForm::buildForm in modules/search_api_solr_admin/src/Form/SolrUploadConfigsetForm.php
Form constructor.

File

src/Utility/Utility.php, line 1193

Class

Utility
Provides various helper functions for Solr backends.

Namespace

Drupal\search_api_solr\Utility

Code

public static function getSolrCloudConnector(ServerInterface $server) : SolrCloudConnectorInterface {
  $connector = self::getSolrConnector($server);
  if (!$connector
    ->isCloud()) {
    throw new SearchApiSolrException(sprintf('The configured connector for server %s (%s) is not a cloud connector.', $server
      ->label(), $server
      ->id()));
  }
  return $connector;
}