Skip to content
Erlang client for the Sphinx search engine
Erlang Perl
Find file
Pull request Compare This branch is 17 commits ahead of kevsmith:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src
tests
.gitignore
Makefile
README.markdown

README.markdown

Description

giza is a client library for the Sphinx search engine (http://www.sphinxsearch.com). It speaks Sphinx's binary searchd protocol natively.

giza currently supports the following features:

  • Full text (Unicode) searching
  • Attribute filters (numeric values only)
  • Index updates
  • Pagination via query limit and offset
  • Document id ranges via min_id and max_id
  • Updating document attributes

To Do:

  • Excerpt support
  • Support for more query fields
  • Generic Sphinx test harness

Patches are always welcome ;-)

Examples

  1. Performing a simple search:
    Query = giza_query:new("users", "frederickson"),
    Results = giza_request:send(Query)
    
  2. Performing a paginated search:
    Q = giza_query:new("users", "frederickson"),
    Q1 = giza_query:offset(Q, 10),
    Results = giza_request:send(Q1)
    
  3. Querying a non-default host:
    Q = giza_query:new("users", "frederickson"),
    Q1 = giza_query:host(Q, "search.somewhere"),
    Results = giza_request:send(Q1)
    
  4. Using giza's attribute filtering:
    Q = giza_query:new("users", "frederickson"),
    %% This is an inclusionary filter by default
    Q1 = giza_query:add_filter(Q, "user_type", [1,3,5]),
    Results = giza_request:send(Q1)
    
    Q = giza_query:new("users", "frederickson"),
    %% Filter with explicit exclude info (exclude == true)
    Q1 = giza_query:add_filter(Q, "user_type", true, [1,3,5]),
    Results = giza_request:send(Q1)
    
  5. Updating a Sphinx index using giza:
    U = giza_update:new("users"),
    U1 = giza_update:add_attribute(U, "user_type"),
    U2 = giza_update:add_doc(U1, 12345, [1]),
    %% Returns number of docs updated
    giza_request:send(U2),
    

Thanks to Nick Gerakines and the folks at EA for supporting giza!

Something went wrong with that request. Please try again.