2017 © Pedro Peláez
 

library fsphinxphp

Facet extension for Sphinx Search

image

gigablah/fsphinxphp

Facet extension for Sphinx Search

  • Tuesday, April 7, 2015
  • by Gigablah
  • Repository
  • 10 Watchers
  • 54 Stars
  • 16,856 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 14 Forks
  • 2 Open issues
  • 4 Versions
  • 4 % Grown

The README.md

FSphinx is a PHP port of the fSphinx Python library, which extends the Sphinx API to easily perform faceted search., (*1)

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., (*2)

How do I use this?

You can incorporate it into your project using Composer. Create a composer.json file and run composer install:, (*3)

{
    "require": {
        "gigablah/fsphinxphp": "1.1.*"
    }
}

This generates an autoloader with namespace mappings:, (*4)

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., (*5)

To learn more, please refer to the tutorial or the documentation., (*6)

Requirements

  • PHP 5.3+ (namespaces, anonymous functions)
  • Sphinx 1.10+ (string attributes)

Author

Chris Heng hengkuanyen@gmail.com, (*7)

License

Released under the GNU LGPL version 3. See the LICENSE file for more details., (*8)

Acknowledgements

This library is based off the excellent work of Alex Ksikes., (*9)

The Versions

07/04 2015

dev-master

9999999-dev https://github.com/gigablah/fsphinxphp

Facet extension for Sphinx Search

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

api search sphinx facet

04/10 2013

1.1.x-dev

1.1.9999999.9999999-dev https://github.com/gigablah/fsphinxphp

Facet extension for Sphinx Search

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

api search sphinx facet

04/10 2013

1.1.1

1.1.1.0 https://github.com/gigablah/fsphinxphp

Facet extension for Sphinx Search

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

api search sphinx facet

12/11 2012

1.1.0

1.1.0.0 https://github.com/gigablah/fsphinxphp

Facet extension for Sphinx Search

  Sources   Download

LGPL-3.0

The Requires

 

The Development Requires

api search sphinx facet