PHPackages                             rikiless/sphinx-search - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. rikiless/sphinx-search

ActiveLibrary[API Development](/categories/api)

rikiless/sphinx-search
======================

Simple handler to query sphinx search

0.9.4(11y ago)118MITPHPPHP &gt;=5.4

Since Sep 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/rikiless/SphinxSearch)[ Packagist](https://packagist.org/packages/rikiless/sphinx-search)[ RSS](/packages/rikiless-sphinx-search/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (1)Versions (6)Used By (0)

Sphinx Search
=============

[](#sphinx-search)

Handler for Sphinx API Client. It contains most used functions to setup field weights, filter, sorting and multi-quering.

Tested on Sphinx Server 2.1.9 / 2.2.4 and sphinx PECL package 1.3.2.

Requirements
------------

[](#requirements)

This package requires PHP 5.4.

- [Sphinx PHP Client 2.0.1](http://sphinxsearch.googlecode.com/svn/tags/REL_2_0_1/api/)

Installation
------------

[](#installation)

The best way to install this package is using [Composer](https://getcomposer.org/)

```
$ composer require "rikiless/sphinx-search:@dev"
```

### Nette Framework

[](#nette-framework)

If you are using Nette Framework you can simply register service:

```
sphinx:
		host: localhost
		port: 9312

services:
	- Rikiless\Sphinx\Search(%sphinx%)
```

In presenter:

```
class Presenter ...
{

	/** @var Rikiless\Sphinx\Search @inject */
	public $fulltextSearch;

}
```

Use
---

[](#use)

#### Examples

[](#examples)

Simple query:

```
$fulltext = new Rikiless\Sphinx\Search([
    'host' => 'localhost',
    'port' => 9312
]);

try {
 	/** @var Rikiless\Sphinx\Data $results */
    $results = $fulltext->query('search something');
	var_dump($results->getMatchesList());

} catch (Rikiless\Sphinx\Exception $e) {
    print $e->getMessage();
}
```

Multiple queries with basic setup:

```
$search = 'search something';

$this->fulltextSearch->setIndex('myindex');
$this->fulltextSearch->setLogComment(sprintf('Fulltext query on %s', $this->domain));
$this->fulltextSearch->setFieldWeights([
    'name' => 10,
	'content' => 5,
	'subject_name' => 3,
	'city' => 2,
	'contact_person' => 2
]);

$this->fulltextSearch->resetFilters();
$this->fulltextSearch->setFilterRange('position', 0, 19999999);
$this->fulltextSearch->addQuery($search);

$this->fulltextSearch->resetFilters();
$this->fulltextSearch->setFilterRange('position', 20000000, 29999999);
$this->fulltextSearch->addQuery($search);

try {
    $results = $this->fulltextSearch->runQueries();
} catch (Rikiless\Sphinx\Exception $e) {
    print $e->getMessage();
}

foreach ($results as $row) {
	/** @var Rikiless\Sphinx\Data $row */
	var_dump($row->getMatches());
}
```

Sources
-------

[](#sources)

-
-
- [http://sphinxsearch.com/wiki/doku.php?id=php\_api\_docs](http://sphinxsearch.com/wiki/doku.php?id=php_api_docs)
-

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~3 days

Total

5

Last Release

4238d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ab50478e316b06856e437979d359cc126a7634c6736d27cc94729b1c944bd63a?d=identicon)[rikiless](/maintainers/rikiless)

---

Top Contributors

[![rikiless](https://avatars.githubusercontent.com/u/589851?v=4)](https://github.com/rikiless "rikiless (12 commits)")

---

Tags

apisearchnettefulltextsphinx

### Embed Badge

![Health badge](/badges/rikiless-sphinx-search/health.svg)

```
[![Health](https://phpackages.com/badges/rikiless-sphinx-search/health.svg)](https://phpackages.com/packages/rikiless-sphinx-search)
```

###  Alternatives

[gigablah/sphinxphp

Sphinx Search PHP 5.3+ API with PSR compliance

861.4M16](/packages/gigablah-sphinxphp)[gigablah/fsphinxphp

Facet extension for Sphinx Search

5362.8k](/packages/gigablah-fsphinxphp)[contributte/comgate

Comgate Payment Gateway for Nette Framework

19839.7k1](/packages/contributte-comgate)[hmerritt/imdb-api

IMDB API that can fetch film data and search results

6911.3k](/packages/hmerritt-imdb-api)[kelemen/api-nette

Api for Nette framework

181.9k](/packages/kelemen-api-nette)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
