Skip to content

YiiSolarium integrates Solarium (an opensource Solr client library for PHP applications)

License

Notifications You must be signed in to change notification settings

tosintech-web/YiiSolarium

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YiiSolarium

YiiSolarium integrates Solarium (an opensource Solr client library for PHP applications)

Install

  1. Download YiiSolarium into your application extension directory

    git clone https://github.com/estahn/YiiSolarium.git
    
  2. Run composer within YiiSolarium directory

    cd <application extension dir>/YiiSolarium
    composer install
    
  3. Remove .git directory

    rm -rf .git
    

Configuration

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' => '',
                )
            )
        )
    )
    ...
)

Usage

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);

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b my_markup)
  3. Commit your changes (git commit -am "Added Snarkdown")
  4. Push to the branch (git push origin my_markup)
  5. Open a Pull Request
  6. Enjoy a refreshing Diet Coke and wait

About

YiiSolarium integrates Solarium (an opensource Solr client library for PHP applications)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%