Sphinx is available via MacPorts - but this comes with one important caveat: You must have MySQL and/or PostgreSQL installed via MacPorts as well. If you don’t, then compiling by source is the best approach. Download and try the following set of commands. If you need PostgreSQL support though, scroll down and look at the UNIX section.
There are two common issues that people run into. The first is that iconv and/or the expat XML parser may need to be updated. Clinton Nixon has written some clear instructions on how to handle that.
The other issue only appears when you actually index your data or start the daemon:
A quick fix for this is to add a symlink from where the MySQL libraries are to where Sphinx expects them to be:
You may need to recompile and reinstall Sphinx once this is done.
If you’re running Gentoo, then Sphinx is available via
and Ubuntu have the
sphinxsearch package available to them in apt. I
don’t know what the status is for other distributions and package
management tools, so you may need to compile it yourself.
Compiling by source should be quite painless though. Download the code from the Sphinx website - version 0.9.8.1 is the most recent stable release at the moment. The standard set of commands should install it with MySQL support:
If you need PostgreSQL support, you’ll need to tell the Sphinx configuration step that. It could be as simple as a flag:
But in some cases the path to the libraries will need to be explicitly set:
The libraries path can be determined by running the following command:
If you’re installing Sphinx on Windows, then all you should have to do is grab the relevant installer from the Sphinx website (one has PostgreSQL and MySQL support, one is just for MySQL). Install, and you’re good to go.