This gem is based on the old Rails 2 plugin made by boone (

It allows you to create an auxiliary table to be used for full-text searches. It behaves like a polymorphic association, so it can be used with any ActiveRecord model.

It has been tested on Rails 3.1+. Ruby 1.9.1+.


Add this line to your application's Gemfile:

gem 'acts_as_fulltextable', '~> 0.1'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install acts_as_fulltextable


Create a migration for the models that you want to make searches.

$ rails generate fulltext_rows model1 model2 model3 ....
$ rake db:migrate

Add acts_as_fulltextable in any model, followed by the list of searchable fields.


class Person < ActiveRecord::Base
  attr_accessible :age, :description, :name

  acts_as_fulltextable :description, :name

You can either run a search on a single model: Model.find_fulltext('query to run', :limit => 10, :offset => 0)

Or you can run it on more models at once:'query to run', :only => [:only, :this, :models], :limit => 10, :offset => 0)


Should you add acts_as_fulltextable to a new model after the initial migration was run, you should execute the following piece of code (a migration or script/console are both fine):

  NewModel.find(:all).each {|i| i.create_fulltext_record}


  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request