PHPackages                             karolnet/sphinxbundle - 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. karolnet/sphinxbundle

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

karolnet/sphinxbundle
=====================

Symfony integration for SphinxSearch

1.1.4(10y ago)0199GPL-3.0PHPPHP &gt;=5.3.2

Since Mar 1Pushed 10y ago1 watchersCompare

[ Source](https://github.com/KarolNet/SphinxSearchBundle)[ Packagist](https://packagist.org/packages/karolnet/sphinxbundle)[ RSS](/packages/karolnet-sphinxbundle/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (2)Versions (16)Used By (0)

SphinxSearchBundle
==================

[](#sphinxsearchbundle)

Some SphinxSearch integration with Symfony for `gigablah/sphinxphp` and `foolz/sphinxql-query-builder`. [![Alt text](/doc/images/profiler_error.png?raw=true "Profiler with last error")](/doc/images/profiler_error.png?raw=true)

### Version 0.1.\* was released during [Codewave's shipit day!](http://codewave.eu/pl/shipit-days.html)

[](#version-01-was-released-during-codewaves-shipit-day)

Installation
============

[](#installation)

Install via composer:

`composer require karolnet/sphinxbundle`

Add to AppKernel.php

`new \Ekiwok\SphinxBundle\EkiwokSphinxBundle()`

QueryBuilder
------------

[](#querybuilder)

You may register many connections. Example configuration is:

```
ekiwok_sphinx:
    connection:
        host: localhost
        port: 9306
        driver: pdo

```

Default connection with following configuration will always be created unless you provide alternative default configuration:

```
    host: localhost
    port: 9306
    driver: pdo

```

It means if you want to use pdo and you are running sphinx daemon on localhost on port 9306 you do not have to provide any configuration.

Examples of usage:

```
        $sphinx = $this->get('sphinx');
        $conn = $sphinx->getConnection();
        $recipes = $conn->createQueryBuilder()
                        ->select('id', 'title')
                        ->from('recipes')
                        ->match('title', 'chicken')
                        ->limit(100)
                        ->execute();

```

```
        $sphinx = $this->get('sphinx');
        $conn = $sphinx->getConnection();
        $recipes = $conn->query('SELECT id, title FROM recipes WHERE MATCH("(@title chicken)")');

```

For more please visit

gigablah/sphinxphp
------------------

[](#gigablahsphinxphp)

### Fresh use

[](#fresh-use)

If you are just starting using sphinx in your project all you have to do is declare your default connection:

```
    sphinx.default.connection:
        class: Sphinx\SphinxClient
        calls:
            - [setServer, ['127.0.0.1', 9312] ]

```

Next decorate it with data collector:

```
    sphinx.default:
        class: Ekiwok\SphinxBundle\Sphinx\SphinxDataCollector
        arguments: [@sphinx.default.connection, @sphinx_stats]

```

`@sphinx_stats` is service that provides data to profiler. You may implement your own provider by implementing: `Ekiwok\SphinxBundle\Sphinx\SphinxDataCollector`

Now use `sphinx.default` like `Sphinx\SphinxClient`.

`$sphinxClient = $this->get('sphinx.default');`

### Replacing Sphinx\\SphinxClient

[](#replacing-sphinxsphinxclient)

#### Symfony 2.5+

[](#symfony-25)

If you are using Symfony 2.5+ you may be interested in service decoration: [http://symfony.com/doc/current/components/dependency\_injection/advanced.html#decorating-services](http://symfony.com/doc/current/components/dependency_injection/advanced.html#decorating-services)

#### Replacing Sphinx\\SphinxClient

[](#replacing-sphinxsphinxclient-1)

If you have your SphinxClient registered for example as `sphinx.default` use little hack, change this service name to `sphinx.default.connection`and register SphinxDataCollector as `sphinx.default`. Because SphinxDataCollector extends SphinxClient it shoud have no side effects on your project:

```
    sphinx.default:
        class: Ekiwok\SphinxBundle\Sphinx\SphinxDataCollector
        arguments: [@sphinx.default.connection, @sphinx_stats]

```

You can always instantiate SphinxDataCollector manually (for example in situation when you don't have your SphinxClient managed by container)

```
    // $sphinxClient is instance of Sphinx\SphinxClient
    $sphinxStats = $this->get('sphinx_stats');
    $sphinxClient = new \Ekiwok\SphinxBundle\Sphinx\SphinxDataCollector($sphinxClient, $sphinxStats);

```

What does this bundle do?
=========================

[](#what-does-this-bundle-do)

Well, it shows fancy things and stuff in profiler and toolbar. Those things are now query calls and errors. So all it does is tracking calls of SphinxClient query method and measuring time of this method execution (yeah, it's not actuall query time).

Because SphinxClient uses binary protocol this bundle does not show real human readable queries that may be copied to sphinx cli. (Now =) Unfortunately, it shows just arguments (query, indexes and comment) passed to query method.

This bundle trakcs all errors that unfold during executing queries.

Authors
=======

[](#authors)

This bundle was originally developed by [Piotr Kowalczyk](https://github.com/ekiwok)

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~26 days

Recently: every ~66 days

Total

11

Last Release

3772d ago

Major Versions

0.1.2 → 1.1.32016-01-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/be0f390573cc2afcc5890373d56c0bcef0cc2e21566c49159b6585f36374f8c3?d=identicon)[karol.grochowalski@gmail.com](/maintainers/karol.grochowalski@gmail.com)

---

Top Contributors

[![ekiwok](https://avatars.githubusercontent.com/u/5066380?v=4)](https://github.com/ekiwok "ekiwok (10 commits)")[![KarolNet](https://avatars.githubusercontent.com/u/5453553?v=4)](https://github.com/KarolNet "KarolNet (5 commits)")

---

Tags

searchprofilersphinxsphinxsearch

### Embed Badge

![Health badge](/badges/karolnet-sphinxbundle/health.svg)

```
[![Health](https://phpackages.com/badges/karolnet-sphinxbundle/health.svg)](https://phpackages.com/packages/karolnet-sphinxbundle)
```

###  Alternatives

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

PHPackages © 2026

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