andrew-s / codeigniter-sphinxrt

5 stars 5 forks source link

SphinxRT (Real Time Indexes) for CodeIgniter 2+

This library allows you to communicate with Sphinx via it's SphinxQL (SQL-esque) method of inserting, updating, deleting and searching. This library only works with with Real Time indexes but you technically could use it to search a normal Sphinx Index. This library makes use of the SphinxQL language over the SpinxAPI (this method has been proven that in-scale, the SphinxQL system works more efficiently and can handle more requests per second).

Currently Supported

There are several elements currently supported but to this is only to a basic level, more error-proofing and complex queries need to be added.

Requirements

TODO

Usage Example

Example of using insert:

    $this->sphinxrt->insert('example', array('a_id' => 5,
                                             'name' => 'Example'));

Example of using search:

    $result = $this->sphinxrt->search('example', array('search'     => 'my query',
                                                       'limit'      => 100,
                                                       'start'      => 0,
                                                       'where'      => array('is_active,=' => 1)));

Example of using update:

    $this->sphinxrt->update('example', array('a_id' => 5,
                                             'name' => 'Example'));

Notes