PHPackages                             yurunsoft/sphinx-client-swoole - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. yurunsoft/sphinx-client-swoole

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

yurunsoft/sphinx-client-swoole
==============================

Sphinx Client 支持 Swoole 协程环境

v1.0.0(7y ago)3921GPL-2.0PHPPHP &gt;=7.0

Since Jul 27Pushed 7y ago1 watchersCompare

[ Source](https://github.com/Yurunsoft/SphinxClient-Swoole)[ Packagist](https://packagist.org/packages/yurunsoft/sphinx-client-swoole)[ RSS](/packages/yurunsoft-sphinx-client-swoole/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

SphinxClient-Swoole
===================

[](#sphinxclient-swoole)

[![Latest Version](https://camo.githubusercontent.com/accda5712cb175e6f384e38fa3293c198704457e9e43747573e2ee796a98a2b3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f797572756e736f66742f737068696e782d636c69656e742d73776f6f6c652e737667)](https://packagist.org/packages/yurunsoft/sphinx-client-swoole)[![Php Version](https://camo.githubusercontent.com/6455456103bcc3f8f07b7bd00c1fb29c57764dfe9205e449e9e441dbc5e44bfe/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d2533453d372e302d627269676874677265656e2e737667)](https://secure.php.net/)[![Swoole Version](https://camo.githubusercontent.com/de750c41d0c2a47c9ef7d3a82af1c1e0dd595db5750cfe21d10618f4d20abfc6/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f73776f6f6c652d2533453d342e302e332d627269676874677265656e2e737667)](https://github.com/swoole/swoole-src)[![IMI License](https://camo.githubusercontent.com/ae2ab554c4a11f3fce94b87d91ce06c9d946c1739b9fe1d0f9bd1733476eb544/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f597572756e736f66742f537068696e78436c69656e742d53776f6f6c652e737667)](https://github.com/Yurunsoft/SphinxClient-Swoole/blob/master/LICENSE)

介绍
--

[](#介绍)

这是一个适合用于 Swoole 协程环境下的 SphinxClient，支持内置连接池。

代码基于 Sphinx 官方自带的 SphinxClient 修改，完全遵守原项目的 GPL-2.0 协议。

使用说明
----

[](#使用说明)

Composer:`"yurunsoft/sphinx-client-swoole":"~1.0"`

使用方式和 Sphinx 官方自带的 SphinxClient 并无两样，唯一需要注意的是只支持在 Swoole 协程下运行。

### 连接池

[](#连接池)

```
// 初始化连接池，改为你自己的连接配置
SphinxPool::init(5, '192.168.0.110', 9312);
// 连接池使用
SphinxPool::use(function($sphinxClient){
	// 改成你自己的搜索名和索引名
	$result = $sphinxClient->Query('query string', 'indexName');

	if($result)
	{
		var_dump($result['total']);
	}
	else
	{
		var_dump($sphinxClient->GetLastError());
	}
});
```

### 直接实例化

[](#直接实例化)

```
$client = new SphinxClient;
// 改为你自己的连接配置
$client->SetServer('192.168.0.110', 9312);
// 改成你自己的搜索名和索引名
var_dump($client->Query('query string', 'indexName'));
```

更加详细的示例代码请看`test`目录下代码。

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

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

Unknown

Total

1

Last Release

2845d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f917bb42280d114c53cebadc2942a13ee03abe14971089f88895e266d637169?d=identicon)[Yurunsoft](/maintainers/Yurunsoft)

---

Top Contributors

[![Yurunsoft](https://avatars.githubusercontent.com/u/20104656?v=4)](https://github.com/Yurunsoft "Yurunsoft (6 commits)")

---

Tags

coroutinesphinxswoole

### Embed Badge

![Health badge](/badges/yurunsoft-sphinx-client-swoole/health.svg)

```
[![Health](https://phpackages.com/badges/yurunsoft-sphinx-client-swoole/health.svg)](https://phpackages.com/packages/yurunsoft-sphinx-client-swoole)
```

PHPackages © 2026

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