YiiSolarium integrates Solarium (an opensource Solr client library for PHP applications)
-
Download YiiSolarium into your application extension directory
git clone https://github.com/estahn/YiiSolarium.git
-
Run composer within YiiSolarium directory
cd <application extension dir>/YiiSolarium composer install
-
Remove .git directory
rm -rf .git
YiiSolarium is a Yii application component. A comprehensive overview of the configuration parameters for Solarium can be found in the Solarium documentation.
Example:
'components' => array(
...
'solarium' => array(
'class' => 'application.extensions.YiiSolarium.Solarium',
'clientOptions' => array(
'endpoint' => array(
'localhost' => array(
'host' => '127.0.0.1',
'port' => '8089',
'path' => '',
)
)
)
)
...
)
Solarium is accessible through Yii::app()->solarium
.
Example:
/** @var $client Solarium\Client */
$client = Yii::app()->solarium->getClient();
$query = $client->createSelect();
$query->setFields(array('name'));
$query->setQuery('name:%p1%', array('Bob'));
$query->setRows(3);
$result = $client->select($query);
- Fork it.
- Create a branch (
git checkout -b my_markup
) - Commit your changes (
git commit -am "Added Snarkdown"
) - Push to the branch (
git push origin my_markup
) - Open a Pull Request
- Enjoy a refreshing Diet Coke and wait