Surf Roots, Software Thoughts

A blog by Alex Loddengaard

Ruby on Rails: Building a Reverse Index for Search

Wow.  I’ve never been so impressed with a framework.  Take a look at this guide to create a reverse index for search in Ruby on Rails.  Here’s the basic idea:

  1. Install a gem
  2. Install a plugin
  3. Specify the fields for each model that should be indexed
  4. Call the find_by_contents method

Insane!  I used Lucene with Timedex, and I can’t even begin to explain how much more work that was.

So rad!

2 Comments so far

  1. Clint May 9th, 2008 11:43 am

    Ferret is awesome on Rails, but creating queries that relate between relationships can be tricky the first time you try, and when deploying I’d recommend including the ferret server commands in some script because it’s all too easy to forget it exists.

  2. Alex Loddengaard May 9th, 2008 12:13 pm

    Thanks for the heads up, Clint!

Leave a reply