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!

  • http://dontexplain.com Clint

    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.

  • http://www.alexloddengaard.com Alex Loddengaard

    Thanks for the heads up, Clint!