Erlang client for the Sphinx search engine
Erlang Perl
Switch branches/tags
Nothing to show
Clone or download
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.



giza is a client library for the Sphinx search engine ( 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 ;-)


  1. Performing a simple search:
    Query = giza_query:new("users", "frederickson"),
    Results = giza_request:send(Query)
  1. Performing a paginated search:
    Q = giza_query:new("users", "frederickson"),
    Q1 = giza_query:offset(Q, 10),
    Results = giza_request:send(Q1)
  1. Querying a non-default host:
    Q = giza_query:new("users", "frederickson"),
    Q1 = giza_query:host(Q, "search.somewhere"),
    Results = giza_request:send(Q1)
  1. 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)
  1. 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

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