PHPackages                             tear/sphinxsearch-bundle - 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. tear/sphinxsearch-bundle

AbandonedSymfony-bundle[Search &amp; Filtering](/categories/search)

tear/sphinxsearch-bundle
========================

Sphinx search bundle for Symfony 2

1.1.0(13y ago)21421BSD-2-ClausePHPPHP &gt;=5.3.3

Since Sep 8Pushed 13y ago1 watchersCompare

[ Source](https://github.com/leonnleite/Tear-SphinxsearchBundle)[ Packagist](https://packagist.org/packages/tear/sphinxsearch-bundle)[ Docs](https://github.com/timewasted/Search-SphinxsearchBundle)[ RSS](/packages/tear-sphinxsearch-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

About Tear-SphinxsearchBundle
=============================

[](#about-tear-sphinxsearchbundle)

Sphinx search bundle for Symfony 2

Installation:
=============

[](#installation)

\##Bring in the vendor libraries

This can be done in two different ways:

**First Way** : Use Composer *(recommended)*

```
// composer.json
"require": {
    "php": ">=5.3.2",
    // ...
    "tear/sphinxsearch-bundle": "dev-master",
    // ...
}

```

**Second Way** : git command

```
git submodule add git://github.com/leonnleite/Tear-SphinxsearchBundle.git vendor/tear/sphinxsearch-bundle

```

Configuration:
==============

[](#configuration)

```
// app/config/config.yml
sphinxsearch:
    indexes:
        indexName: %sphinxsearch_index_indexName%
        indexNameTwo:      %sphinxsearch_index_indexNameTwo%
searchd:
    host:   %sphinxsearch_host%
    port:   %sphinxsearch_port%
    socket: %sphinxsearch_socket%
indexer:
    bin:    %sphinxsearch_indexer_bin%

```

At least one index must be defined, and you may define as many as you like.

In the above sample configuration, `indexName` is used as a label for the index named `%sphinxsearch_index_indexName%`as defined in your `sphinxsearch.conf`).
This allows you to avoid having to hard code raw index names inside of your code.

Usage examples:
---------------

[](#usage-examples)

The most basic search, using the above configuration as an example, would be:

```
$indexesToSearch = array(
  'Items' => array(),
  'Categories' => array(),
);
$sphinxSearch = $this->get('search.sphinxsearch.search');
$searchResults = $sphinxSearch->search('search query', $indexesToSearch);
```

This performs a search for `search query` against the indexes labeled `Items` and `Categories`. The results of the search would be stored in `$searchResults['Items']` and `$searchResults['Categories']`.

You can also perform more advanced searches, such as:

```
$indexesToSearch = array(
  'Items' => array(
    'result_offset' => 0,
    'result_limit' => 25,
    'field_weights' => array(
      'Name' => 2,
      'SKU' => 3,
    ),
  ),
  'Categories' => array(
    'result_offset' => 0,
    'result_limit' => 10,
  ),
);
$sphinxSearch = $this->get('search.sphinxsearch.search');
$sphinxSearch->setMatchMode(SPH_MATCH_EXTENDED2);
$sphinxSearch->setFilter('disabled', array(1), true);
$searchResults = $sphinxSearch->search('search query', $indexesToSearch);
```

This would again search `Items` and `Categories` for `search query`, but now `Items` will return up to the first 25 matches and weight the `Name` and `SKU` fields higher than normal, and `Categories` will return up to the first 10. Note that in order to define a `result_offset` or a `result_limit`, you must explicitly define both values. Also, this search will use [the Extended query syntax](http://sphinxsearch.com/docs/current.html#extended-syntax), and exclude all results with a `disabled` attribute set to 1.

```
Copyright (c) 2012, Ryan Rogers
All rights reserved.

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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

Unknown

Total

1

Last Release

4998d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/110bbd97c3a03f63251f1519b1f5af4332c96943aeda437bed79f08ff9dfbe5f?d=identicon)[leonnleite](/maintainers/leonnleite)

---

Top Contributors

[![leonnleite](https://avatars.githubusercontent.com/u/1596192?v=4)](https://github.com/leonnleite "leonnleite (4 commits)")[![nilportugues](https://avatars.githubusercontent.com/u/550948?v=4)](https://github.com/nilportugues "nilportugues (1 commits)")

---

Tags

Symfony2sphinxsphinxsearch

### Embed Badge

![Health badge](/badges/tear-sphinxsearch-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/tear-sphinxsearch-bundle/health.svg)](https://phpackages.com/packages/tear-sphinxsearch-bundle)
```

###  Alternatives

[search/sphinxsearch-bundle

Sphinx search bundle for Symfony 2

4013.0k](/packages/search-sphinxsearch-bundle)[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)
