Installing Sphinx with Postgres on Leopard

I didn’t find a quick short guide to installing sphinx on Leopard with PostgreSQL, hence here goes (this assumes you already installed PostgreSQL).

Compile dependencies

These two libs are required by sphinx according to this blog post.

  ~% mkdir src
  ~% cd src
  ~% curl -O http://ftp.gnu.org/gnu/libiconv/libiconv-1.13.tar.gz
  ~% tar xzf libiconv-1.13.tar.gz
  ~% cd libiconv-1.13
  ~% ./configure --prefix=/usr/local
  ~% make
  ~% sudo make install
  ~% cd ..

  ~% curl -O http://internap.dl.sourceforge.net/sourceforge/expat/expat-2.0.1.tar.gz
  ~% tar xzf expat-2.0.1.tar.gz
  ~% cd expat-2.0.1
  ~% ./configure --prefix=/usr/local
  ~% make
  ~% sudo make install
  ~% cd ..

Compile Sphinx

At this point latest stable release was 0.9.8.1.

  ~% curl -O http://www.sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz
  ~% tar xzf sphinx-0.9.8.1.tar.gz
  ~% cd sphinx-0.9.8.1
  ~% export LDFLAGS="-L/usr/lib"
  ~% ./configure --prefix=/usr/local --with-pgsql --without-mysql
  ~% make
  ~% sudo make install

You’re all set.

References

3 responses to “Installing Sphinx with Postgres on Leopard”

  1. Ruby on Rails: Sphinx, thinking-sphinx and PostgreSQL on Mac OS X | Zoned Out

    [...] Medium eXposure [...]

  2. Gabe

    Thanks, this is very helpful. However when I run: rake thinking_sphinx:index from my rails app I get below, do I need any additional steps?

    Sphinx cannot be found on your system. You may need to configure the following settings in your config/sphinx.yml file: * bin_path * searchd_binary_name * indexer_binary_name

    For more information, read the documentation: http://freelancing-god.github.com/ts/en/advanced_config.html Generating Configuration to /Users/gabemcmillan/rails_projects/pa1/config/development.sphinx.conf sh: /users/gabemcmillan/src/sphinx-0.9.9/src/indexer: No such file or directory

  3. will

    What do you find lacking in the full text search that comes with Postgres that you need feel you also need Sphinx? http://www.postgresql.org/docs/9.1/static/textsearch.html

Leave a Reply