So you have decided to add full-text searching to your Ruby on Rails application. After some investigation (see here and here) Sphinx with the Ultrasphinx plugin looks like the best solution for your needs. Just one problem, despite your deployment environment being Linux, for various reasons your current development environment is Windows. While Sphinx runs on Windows, it explicitly states it prefers to run on other systems and there are a few little gotchas. Here is the step by step guide to getting it working:
gem install chronic
svn export svn://rubyforge.org/var/svn/fauna/ultrasphinx/trunk vendor/plugins/ultrasphinx
rake ultrasphinx:configure
You should now have a Sphinx conf
file.ultrasphinx:index
You should now have an index in the
location specified in the conf path.ultrasphinx:daemon:start
The sphinx daemon should start
up.Update: In case you are not reading the comments, Naomi Novik has pointed out that Sphinx/Ultrasphinx doesn’t seem to want to work if the Rails project is in a directory with spaces in the path.
Update: Some people have had problems beyond those I mentioned above. Take a look at this and this if you have extra problems.
Comments: I have removed the commenting system (for privacy concerns), below are the comments that were left on this post before doing so…
Naomi Novik @ 2008-04-06 - Thanks so much for this terrific rundown – saved much much time. I thought I would add on that one other problem in Windows I encountered is that Sphinx/Ultrasphinx doesn’t seem to want to work if the Rails project is in a directory with spaces in the path (eg if you’re working under My Documents or whatnot).