PHPackages                             romeoz/rock-sphinx - 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. [Search &amp; Filtering](/categories/search)
4. /
5. romeoz/rock-sphinx

ActiveLibrary[Search &amp; Filtering](/categories/search)

romeoz/rock-sphinx
==================

Object Relational Mapping (ORM) for Sphinx Search.

0.14.0(10y ago)11271MITPHPPHP &gt;=5.4.0

Since Mar 5Pushed 10y ago1 watchersCompare

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

READMEChangelog (8)Dependencies (6)Versions (9)Used By (0)

ORM for Sphinx Search
=====================

[](#orm-for-sphinx-search)

This API [Sphinx](http://sphinxsearch.com/docs) full text search engine, which uses [SphinxQL](http://sphinxsearch.com/docs/current.html#sphinxql-reference).

Independent fork by [Yii2 Sphinx Search 2.0.4](https://github.com/yiisoft/yii2-sphinx).

[![Latest Stable Version](https://camo.githubusercontent.com/25e501db01c1b016fd88d3b89598e0555b62cc6361f78cdd8848924ed00e9937/68747470733a2f2f706f7365722e707567782e6f72672f726f6d654f7a2f726f636b2d737068696e782f762f737461626c652e737667)](https://packagist.org/packages/romeOz/rock-sphinx)[![Total Downloads](https://camo.githubusercontent.com/7e84ed0d0e8108e9e98a21fd1815dc2d760b85065b7365e2f1d469ca78cdc4eb/68747470733a2f2f706f7365722e707567782e6f72672f726f6d654f7a2f726f636b2d737068696e782f646f776e6c6f6164732e737667)](https://packagist.org/packages/romeOz/rock-sphinx)[![Build Status](https://camo.githubusercontent.com/58b733f41f6f06bdd3b12afbf3353a61a0d0e49c476eb4ad9b2b363c21e5731c/68747470733a2f2f7472617669732d63692e6f72672f726f6d654f7a2f726f636b2d737068696e782e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/romeOz/rock-sphinx)[![HHVM Status](https://camo.githubusercontent.com/448ba0a2de72e4d65ce4d68bede3440e31a8a7f2ac5d8565e63f673c0b4fe848/687474703a2f2f6868766d2e683463632e64652f62616467652f726f6d656f7a2f726f636b2d737068696e782e737667)](http://hhvm.h4cc.de/package/romeoz/rock-sphinx)[![Coverage Status](https://camo.githubusercontent.com/c015b587988aa458df3c30baacd5b025fa8b1d4b74b479d37ebbd2e0cc2063cc/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f726f6d654f7a2f726f636b2d737068696e782f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/r/romeOz/rock-sphinx?branch=master)[![License](https://camo.githubusercontent.com/8cc32a735e728cbf80bdcca1a1a9e86e0616406d2df6b2853c9860e2291a591e/68747470733a2f2f706f7365722e707567782e6f72672f726f6d654f7a2f726f636b2d737068696e782f6c6963656e73652e737667)](https://packagist.org/packages/romeOz/rock-sphinx)

Features
--------

[](#features)

- Query Builder/DBAL/DAO: Querying the database using a simple abstraction layer
- Active Record: The Active Record ORM, retrieving and manipulating records, and defining relations
- Support [Runtime Indexes](http://sphinxsearch.com/docs/current.html#rt-indexes)
- [Call Snippets](http://sphinxsearch.com/docs/current.html#sphinxql-call-snippets)
- Behaviors (TimestampBehavior,...)
- Data Provider
- **Validation and Sanitization rules for AR (Model)**
- **Query Caching**
- **Standalone module/component for [Rock Framework](https://github.com/romeOz/rock)**

> Bolded features are different from [Yii2 Sphinx Search](https://github.com/yiisoft/yii2-sphinx).

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

[](#installation)

From the Command Line:

```
composer require romeoz/rock-sphinx

```

In your composer.json:

```
{
    "require": {
        "romeoz/rock-sphinx": "*"
    }
}
```

Quick Start
-----------

[](#quick-start)

\####Query Builder

```
$rows =  (new \rock\sphinx\Query)
    ->from('items_idx')
    ->match($_POST['search'])
    ->all();
```

\####Active Record

```
// find
$users = ItemsIndex::find()
    ->match($_POST['search'])
    ->all();

// insert to runtime index
$record = new RuntimeIndex;
$record->id = 15;
$record->name = 'Tom';
$users ->save();
```

Documentation
-------------

[](#documentation)

- [Basic](https://github.com/yiisoft/yii2/blob/master/extensions/sphinx/README.md): Connecting to a database, basic queries, query builder, and Active Record
- [Data Providers](https://github.com/romeOz/rock-sphinx/blob/master/docs/data-provider.md)

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

[](#requirements)

- **PHP 5.4+**
- For validation rules a model required [Rock Validate](https://github.com/romeOz/rock-validate): `composer require romeoz/rock-validate`
- For sanitization rules a model required [Rock Sanitize](https://github.com/romeOz/rock-sanitize): `composer require romeoz/rock-sanitize`
- For using behaviors a model required [Rock Behaviors](https://github.com/romeOz/rock-behaviors): `composer require romeoz/rock-behaviors`
- For using Data Provider required [Rock Data Provider](https://github.com/romeOz/rock-dataprovider/): `composer require romeoz/rock-dataprovider`
- For caching queries required [Rock Cache](https://github.com/romeOz/rock-behaviors): `composer require romeoz/rock-cache`

> All unbolded dependencies is optional.

License
-------

[](#license)

The Object Relational Mapping (ORM) for Sphinx Search is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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 ~35 days

Total

8

Last Release

3843d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/23c5d84a59845d751cb69f5469986579b9312c54c898b366fefdc05baaa80a9c?d=identicon)[romeOz](/maintainers/romeOz)

---

Top Contributors

[![romeOz](https://avatars.githubusercontent.com/u/3135712?v=4)](https://github.com/romeOz "romeOz (90 commits)")

---

Tags

searchactive-recordsphinxqlsphinxsphinxsearchsearch engine

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/romeoz-rock-sphinx/health.svg)

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

###  Alternatives

[ripaclub/sphinxsearch

Sphinx Search library provides SphinxQL indexing and searching features

6232.2k3](/packages/ripaclub-sphinxsearch)[nilportugues/sphinx-search

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

18452.9k2](/packages/nilportugues-sphinx-search)[javer/sphinx-bundle

Provides integration of Sphinx search engine with Symfony using SphinxQL

24185.4k](/packages/javer-sphinx-bundle)[opensearchserver/opensearchserver

PHP library for OpenSearchServer: professionnal search engine, crawlers (web, file, database), REST APIs, .... This library uses OpenSearchServer's V2 API.

5267.5k](/packages/opensearchserver-opensearchserver)[algolia/laravel-scout-algolia-macros

A collection macros to extend Laravel Scout with more Algolia capabilities

3633.7k](/packages/algolia-laravel-scout-algolia-macros)[ymigval/laravel-indexnow

Laravel Service Library for notifying search engines about the latest content changes on their URLs using IndexNow.

3410.2k](/packages/ymigval-laravel-indexnow)

PHPackages © 2026

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