You are here

public function Apache_Solr_Service_Balancer::__construct in Apache Solr Search 5

Constructor. Takes arrays of read and write service instances or descriptions

Parameters

array $readableServices:

array $writeableServices:

File

SolrPhpClient/Apache/Solr/Service/Balancer.php, line 91

Class

Apache_Solr_Service_Balancer
Reference Implementation for using multiple Solr services in a distribution. Functionality includes: routing of read / write operations failover (on selection) for multiple read servers

Code

public function __construct($readableServices = array(), $writeableServices = array()) {

  //setup readable services
  foreach ($readableServices as $service) {
    $this
      ->addReadService($service);
  }

  //setup writeable services
  foreach ($writeableServices as $service) {
    $this
      ->addWriteService($service);
  }
}