I wanted to set up searching on my military reading lists site, and while the dataset is small enough that a SQL LIKE query would have done the trick, I wanted to introduce a real search engine in the mix. Thanks to a couple of helpful posts from Neeraj Kumar and Rein Henrichs, it was simple to get the basic functionality up and running. I'm using the latest UltraSphinx code from GitHub and as far as I can tell everything is working fine with Ruby 1.8.6, Passenger 2.0.5, and Rails 2.2.2.
The only thing I would add to Rein's post is a variation on his Capistrano tasks. He uses this:
namespace :sphinx do
desc "Generate the ThinkingSphinx configuration file"
task :configure do
run "cd #{release_path} && rake thinking_sphinx:configure"
end
end
after "deploy:update_code", "sphinx:configure"
and I used this:
def run_remote_rake(rake_cmd)
run "cd #{current_path} && /usr/local/bin/rake RAILS_ENV=production #{rake_cmd}"
end
after "deploy", "ultrasphinx:configure"
My technique is slightly shorter, but his method would allow you to run that task independently of a deploy. I reckon both ways work.
That's a nifty little site! So did you stop with O'Brian after Master_and_Commander? I picked that one up the summer after O'Brian died in 2000 and blasted through the rest of the series in about ten months!
Posted by: Ashley Tate | December 23, 2008 at 02:03 PM
@ashley - thanks! Yeah, it's been fun reading through those books. I should pick up on Master and Commander again... right now I'm plowing through the USMC list - read "We Were Soldiers" and "Flags of our Fathers" and now reading "Army at Dawn". Great stuff!
Posted by: tomcopeland | December 23, 2008 at 02:06 PM