gigablah/fsphinxphp
Composer 安装命令:
composer require gigablah/fsphinxphp
包简介
Facet extension for Sphinx Search
README 文档
README
FSphinx is a PHP port of the [fSphinx] 1 Python library, which extends the Sphinx API to easily perform faceted search.
What's faceted search?
Think of "filtering", "refining" or "drilling down". For example, when searching through a database of movie titles, you could get a list of clickable refinement options such as actors, directors, genre and year of release. Unlike static hierarchical navigation, facets are calculated as you search so you always get options that are relevant to your current query terms.
How do I use this?
You can incorporate it into your project using [Composer] 2. Create a composer.json file and run composer install:
{
"require": {
"gigablah/fsphinxphp": "1.1.*"
}
}
This generates an autoloader with namespace mappings:
require __DIR__ . '/vendor/autoload.php';
$fsphinx = new FSphinx\FSphinxClient();
$fsphinx->setServer('127.0.0.1', 9312);
$fsphinx->setDefaultIndex('items');
$fsphinx->setMatchMode(FSphinx\FSphinxClient::SPH_MATCH_EXTENDED2);
$fsphinx->attachQueryParser(new FSphinx\MultiFieldQuery());
$fsphinx->attachFacets(new FSphinx\Facet('actor'), new FSphinx\Facet('director'), new FSphinx\Facet('year'));
$results = $fsphinx->query('action');
foreach ($results['facets'] as $facet) print_r($facet);
If you're not using Composer, you can use fsphinxapi.php to load the FSphinx classes.
To learn more, please refer to the [tutorial] 3 or the [documentation] 4.
Requirements
- PHP 5.3+ (namespaces, anonymous functions)
- Sphinx 1.10+ (string attributes)
Author
[Chris Heng] 5 hengkuanyen@gmail.com
License
Released under the GNU LGPL version 3. See the LICENSE file for more details.
Acknowledgements
This library is based off the excellent work of [Alex Ksikes] 6.
gigablah/fsphinxphp 适用场景与选型建议
gigablah/fsphinxphp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 63.84k 次下载、GitHub Stars 达 53, 最近一次更新时间为 2012 年 11 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「api」 「search」 「sphinx」 「facet」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 gigablah/fsphinxphp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 gigablah/fsphinxphp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 gigablah/fsphinxphp 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel package to retrieve data from Google Search Console
Indexed Search Autocomplete - Extends the TYPO3 Core Extension Indexed_Search searchform with an autocomplete feature.
A Laravel query builder for SphinxQL
A Sphinx Query Builder extension for the Laravel Database package
Abstraction Layer to index and search entities
Laravel package to query Sphinxsearch in Laravel 5
统计信息
- 总下载量: 63.84k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 53
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0
- 更新时间: 2012-11-22