Full text searching in rails

Use acts_as_ferret

I had serious trouble with adding conditions to acts_as_ferret in order to query only for a certain user_id. You have to do the following with the little {}

            @records = Record.find_by_contents params[:search], {}, {:conditions => ["user_id = ?", current_user]}

And to run it on a production server - go here

Comments

  1. Scott Motte | June 16, 2008

    Simple search might be the better way to go. See Ryan Bates’ episode 37.