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

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

cugr/sphinxsearch
=================

Laravel package of Sphinxsearch for Laravel ^5.4

13.0k1PHP

Since Aug 18Pushed 8y ago1 watchersCompare

[ Source](https://github.com/liub1993/sphinxsearch)[ Packagist](https://packagist.org/packages/cugr/sphinxsearch)[ RSS](/packages/cugr-sphinxsearch/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Sphinx Search for Laravel 5.4
=============================

[](#sphinx-search-for-laravel-54)

Simple Laravel 5.4 package for make queries to Sphinx Search.

Inspired by [sngrl/sphinxsearch](https://github.com/sngrl/sphinxsearch), and made it also usable in Laravel 5.4.

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

[](#installation)

Run the following command in your console to pull down the package from packagist.

```
composer require cugr/sphinxsearch:dev-master
```

After updating composer, add the ServiceProvider to the "providers" array in config/app.php:

```
	'providers' => [
        /*** Some others providers ***/
        CuGR\SphinxSearch\SphinxSearchServiceProvider::class,
    ],
```

You can add this line to the files, where you may use SphinxSearch:

```
use CuGR\SphinxSearch\SphinxSearch;
```

Configuration
=============

[](#configuration)

To use Sphinx Search, you need to configure your indexes and what model it should query. To do so, publish the configuration into your app.

```
php artisan vendor:publish --provider="CuGR\SphinxSearch\SphinxSearchServiceProvider"
```

This will create the file `config/sphinxsearch.php`. Modify as needed.

Usage
=====

[](#usage)

Basic query (raw sphinx results)

```
$sphinx = new SphinxSearch();  // or $sphinx = new SphinxSearch('connection_name');
$results = $sphinx->search('my query', 'index_name')->query();
```

Basic query (with Eloquent)

```
$results = $sphinx->search('my query', 'index_name')->get();
```

Query another Sphinx index with limit and filters.

```
$results = $sphinx->search('my query', 'index_name')
	->limit(30)
	->filter('attribute', array(1, 2))
	->range('int_attribute', 1, 10)
	->get();
```

Query with match and sort type specified.

```
$result = $sphinx->search('my query', 'index_name')
	->setFieldWeights(
		array(
			'partno'  => 10,
			'name'    => 8,
			'details' => 1
		)
	)
	->setMatchMode(\Sphinx\SphinxClient::SPH_MATCH_EXTENDED)
	->setSortMode(\Sphinx\SphinxClient::SPH_SORT_EXTENDED, "@weight DESC")
	->get(true);  //passing true causes get() to respect returned sort order
```

License
=======

[](#license)

CuGR Sphinx Search is open-sourced software licensed under the [MIT license]('LICENSE')

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/14928?v=4)[Bing](/maintainers/Bing)[@bing](https://github.com/bing)

---

Top Contributors

[![sngrl](https://avatars.githubusercontent.com/u/6196684?v=4)](https://github.com/sngrl "sngrl (14 commits)")[![bingbig](https://avatars.githubusercontent.com/u/8176443?v=4)](https://github.com/bingbig "bingbig (7 commits)")[![nekhbet](https://avatars.githubusercontent.com/u/2778861?v=4)](https://github.com/nekhbet "nekhbet (6 commits)")[![jpmurray](https://avatars.githubusercontent.com/u/1550428?v=4)](https://github.com/jpmurray "jpmurray (2 commits)")

### Embed Badge

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

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

###  Alternatives

[awesome-nova/dependent-filter

Dependent filters for Laravel Nova

26190.2k](/packages/awesome-nova-dependent-filter)[algolia/php-dom-parser

A simple tool to turn DOM into Algolia search friendly record objects.

181.8k](/packages/algolia-php-dom-parser)

PHPackages © 2026

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