Created
February 18, 2011 14:03
-
-
Save basdenooijer/833685 to your computer and use it in GitHub Desktop.
Create a Solarium_Client instance in three different ways
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$config = array( | |
'host' => '192.168.1.2', | |
'port' => 8983, | |
'path' => '/solr/', | |
'core' => 'geonames', | |
); | |
$client = new Solarium_Client($config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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