sphinx: Haskell bindings to the Sphinx full-text searching daemon.

[ bsd3, database, library, search, text ] [ Propose Tags ]

Haskell bindings to the Sphinx full-text searching daemon. Compatible with Sphinx version 2.0


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
version-1-1-beta

By default this library is compatible with version 2.0 beta of Sphinx. Use this flag if you use Sphinx 1.1

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.0, 0.1, 0.1.1, 0.2, 0.2.1, 0.3.3, 0.3.4, 0.3.5, 0.3.6, 0.3.7, 0.4.0, 0.4.0.1, 0.4.0.2, 0.4.0.3, 0.4.0.4, 0.4.0.5, 0.5.0, 0.5.1, 0.5.2, 0.5.2.1, 0.5.2.2, 0.5.3, 0.5.3.1, 0.6.0, 0.6.0.1, 0.6.0.2
Dependencies base (>=4 && <5), binary, bytestring, data-binary-ieee754, network, utf8-string (>=0.3), xml [details]
License BSD-3-Clause
Author Chris Eidhof <ce+sphinx@tupil.com>, Greg Weber
Maintainer Greg Weber <greg@gregweber.info>
Category Text, Search, Database
Home page https://github.com/gregwebs/haskell-sphinx-client
Uploaded by GregWeber at 2012-02-07T15:09:27Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 20028 total (41 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs uploaded by user
Build status unknown [no reports yet]

Readme for sphinx-0.5.3.1

[back to package description]

A haskell implementation of a sphinx full text search client. Sphinx is a very fast and featureful full-text search daemon. Version 0.4 is Compatible with sphinx version 1.1-beta Version 0.5 is Compatible with sphinx version 2.0-beta, but you can pass the version-one-one build flag. On hackage.

Usage

query executes a single query. runQueries executes multiple queries at once that were created them with addQuery

In extended mode you may want to escape special query characters with escapeString

buildExcerpts creates highlighted excerpts

You will probably need to import the types also:

import qualified Text.Search.Sphinx as Sphinx
import qualified Text.Search.Sphinx.Types as SphinxT

There is also an Indexable module for generating an xml file of data to be indexed

runQueries helpers

runQueries pipelines multiple queries together. If you are trying to combine the results, there are some helpers such as maybeQueries and resultsToMatches

      mr <- Sphinx.maybeQueries sphinxLogger sphinxConfig [
                 addQuery "db1" query1
               , addQuery "db2" query1
               , addQuery "db1" query2
               , addQuery "db2" query2
               ]
      case mr of
        Nothing -> return Nothing
        Just rs -> do
          let combined = Sphinx.resultsToMatches 20 rs
          if null combined
             then return Nothing
             else return $ Just combined

Details

Implemenation

Implementation of API as detailed in the documentation. Most search and buildExcerpts features are implemented.

History

Originally written by Tupil and maintained by Chris Eidhof for an earlier version of sphinx. Greg Weber improved the library and updated it for the latest version of sphinx, and is now maintaining it.

Usage of this haskell client

Tupil originally wrote this for use on a commercial project. This sphinx package is now finding some use in the Yesod community. Here is a well described example usage, but do keep in mind there is no requirement to tie the generation of sphinx documents to your web application, just your database. Used in Yesod applications yesdoweb.com and eatnutrients.com.