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

ActiveLaravel-package

nekhbet/laravel-sphinxsearch
============================

Laravel package to query SphinxSearch

v1.0.2(7mo ago)078Apache-2.0PHPPHP &gt;=8.0

Since Apr 28Pushed 7mo agoCompare

[ Source](https://github.com/nekhbet/sphinxsearch)[ Packagist](https://packagist.org/packages/nekhbet/laravel-sphinxsearch)[ Docs](https://github.com/nekhbet/laravel-sphinxsearch)[ RSS](/packages/nekhbet-laravel-sphinxsearch/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

This is a maintained version to the latest Laravel (right now 10.x) and to Sphinx 3.x.
======================================================================================

[](#this-is-a-maintained-version-to-the-latest-laravel-right-now-10x-and-to-sphinx-3x)

I'm using it for my personal projects, so it will be up-to-date.
================================================================

[](#im-using-it-for-my-personal-projects-so-it-will-be-up-to-date)

What I have done:

- got rid of "strage" dependencies and included  here, not on yet another repo
- tweaks for PHP 8.x
- make it work with Sphinx 3.x
- various fixes

==========================

To install it:

```
composer require nekhbet/sphinxsearch
```

---

Original notes below:

Sphinx Search for Laravel 5 - Custom build with snippets support
================================================================

[](#sphinx-search-for-laravel-5---custom-build-with-snippets-support)

Simple Laravel 5 package for make queries to Sphinx Search. Inspired by scalia/sphinxsearch package for Laravel 4.

This package was created to import to the site packagist.org and allow installation through Composer ().

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

[](#installation)

Require this package in your composer.json:

```
	"require": {
        /*** Some others packages ***/
		"sngrl/sphinxsearch": "dev-master",
	},
```

Run in your console `composer update` command to pull down the latest version of Sphinx Search.

Or just run this in console:

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

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

```
	'providers' => array(
        /*** Some others providers ***/
        sngrl\SphinxSearch\SphinxSearchServiceProvider::class,
    ),
```

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

```
use sngrl\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=sngrl\SphinxSearch\SphinxSearchServiceProvider --force
```

This will create the file `config/sphinxsearch.php`. Modify as needed the host and port, and configure the indexes, binding them to a table and id column.

```
return array (
	'host'    => '127.0.0.1',
	'port'    => 9312,
	'indexes' => array (
		'my_index_name' => array ( 'table' => 'my_keywords_table', 'column' => 'id' ),
	)
);
```

Or disable the model querying to just get a list of result id's.

```
return array (
	'host'    => '127.0.0.1',
	'port'    => 9312,
	'indexes' => array (
		'my_index_name' => FALSE,
	)
);
```

Usage
=====

[](#usage)

Basic query (raw sphinx results)

```
$sphinx = new SphinxSearch();
$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)

Sngrl Sphinx Search is open-sourced software licensed under the MIT license

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance62

Regular maintenance activity

Popularity9

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity51

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.

###  Release Activity

Cadence

Every ~440 days

Total

3

Last Release

229d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ccbeadbf5faab02fe809b4a46269a2d4b980f776929a63d34a9ffc331f6c3b1?d=identicon)[nekhbet](/maintainers/nekhbet)

---

Top Contributors

[![nekhbet](https://avatars.githubusercontent.com/u/2778861?v=4)](https://github.com/nekhbet "nekhbet (22 commits)")[![sngrl](https://avatars.githubusercontent.com/u/6196684?v=4)](https://github.com/sngrl "sngrl (20 commits)")[![woodymendoza](https://avatars.githubusercontent.com/u/879473?v=4)](https://github.com/woodymendoza "woodymendoza (6 commits)")[![MrBad](https://avatars.githubusercontent.com/u/4605505?v=4)](https://github.com/MrBad "MrBad (2 commits)")[![eleven26](https://avatars.githubusercontent.com/u/10000532?v=4)](https://github.com/eleven26 "eleven26 (1 commits)")[![JeremyHutchings](https://avatars.githubusercontent.com/u/439559?v=4)](https://github.com/JeremyHutchings "JeremyHutchings (1 commits)")

---

Tags

laravelsphinxsphinxsearch

### Embed Badge

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

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

PHPackages © 2026

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