fsphinxphp

PHP Sphinx API extension for faceted search.

  • 所有者: gigablah/fsphinxphp
  • 平台:
  • 許可證: GNU Lesser General Public License v3.0
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

FSphinx is a PHP port of the [fSphinx] 1 Python library, which extends the Sphinx API to easily perform 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
主編程語言PHP
編程語言PHP (語言數: 1)
平台
許可證GNU Lesser General Public License v3.0
所有者活动
創建於2012-01-02 07:49:55
推送於2015-09-03 06:22:54
最后一次提交2015-04-08 00:36:54
發布數3
最新版本名稱1.1.1 (發布於 2013-10-04 12:50:30)
第一版名稱1.0.3 (發布於 2012-11-12 18:01:43)
用户参与
星數55
關注者數10
派生數15
提交數15
已啟用問題?
問題數5
打開的問題數2
拉請求數1
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?