Skip to content

Instantly share code, notes, and snippets.

@basdenooijer
Created February 18, 2011 14:03
Show Gist options
  • Save basdenooijer/833685 to your computer and use it in GitHub Desktop.
Save basdenooijer/833685 to your computer and use it in GitHub Desktop.
Create a Solarium_Client instance in three different ways
<?php
$config = array(
'host' => '192.168.1.2',
'port' => 8983,
'path' => '/solr/',
'core' => 'geonames',
);
$client = new Solarium_Client($config);
<?php
class My_Solr_Client extends Solarium_Client
{
protected function _init()
{
$this->setHost('192.168.1.2');
$this->setPort(8983);
$this->setPath('/solr/');
$this->setCore('geonames');
}
}
$client = new My_Solr_Client;
<?php
$client = new Solarium_Client;
$client->setHost('192.168.1.2');
$client->setPort(8983);
$client->setPath('/solr/');
$client->setCore('geonames');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment