nilportugues/sphinx-search

Fully unit tested SphinxClient (SphinxAPI) for PHP5.3 and above to be used with SphinxSearch

Maintainers

👁 nilportugues

Package info

github.com/nilportugues/php-sphinx-search

Homepage

pkg:composer/nilportugues/sphinx-search

Statistics

Installs: 458 396

Dependents: 3

Suggesters: 0

Stars: 18

Open Issues: 1

1.0.3 2016-03-11 14:34 UTC

Requires

  • php: >=5.3.0

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 7381e8439fc03577d9f980247cca949b44d5f5cb

searchsphinxSphinx Searchsearch enginesphinxapi

This package is auto-updated.

Last update: 2026-06-06 12:36:36 UTC


README

👁 Build Status
👁 Latest Stable Version
👁 Total Downloads
👁 License

This class is a port of the original Sphinx API class by Andrew Aksyonoff and Sphinx Technologies Inc to PHP 5.3 and above.

1. Requirements

  • Composer
  • PHP 5.3 or above
  • SphinxSearch

2. Added removeFilter

While all the existing methods are available and vastly documented in the Sphinx Documentation, this version of the SphinxClient for PHP includes a new method.

  • removeFilter: The original SphinxClient allows you to clear all filters. This method removes a specific filter previously set.
<?php

$sphinxSearch = new \NilPortugues\Sphinx\SphinxClient();

//Do connection and set up search method...
$sphinxSearch->setServer('127.0.0.1',9312);


// Do search...
// Result would contain "The Amazing Spider-Man 2", to be in theatres in 2014.
$sphinxSearch->setFilter('year',array(2014));
$result = $sphinxSearch->query('Spiderman','movies');

// Unset the filter to stop filtering by year
// Now we'll get all the Spiderman movies.
$sphinxSearch->removeFilter('year');
$result = $sphinxSearch->query('Spiderman','movies');

3. Added chainable methods

While updating the code, chaining capability has been added. SphinxClient's setters can be chained resulting in a cleaner code.

$sphinxSearch = new \NilPortugues\Sphinx\SphinxClient();

$result = $sphinxSearch
 ->setFilter('year',array(2014))
 ->query('Spiderman','movies')
 ;

5. Author

Nil Portugués Calderó