Quick tutorial
Drop the ferreted.rb file in your Rails lib/ directory, include it in your config/environment.rb and use the acts_as_ferreted method in your ActiveRecord model class.
Basic use:
acts_as_ferreted :fields => [ :title, :body, :created_at ]
Advanced Use:
acts_as_ferreted :fields => {
:title => true, :tags => { :method => :tag_names, :boost => 2 }, :updated_at => { :index => :untokenized_omit_norms, :term_vectors => :no }
:analyzer => Ferret::Analysis::MyAnalyzer.new, :or_default => false
Search
Then search like this:
MyModel.ferret_search("+ruby -slippers", { ferret options }, { active record options })
will_paginate support
This example will return an array of objects suitable for use with the will_paginate plugin helpers:
MyModel.ferret_search("frog squad",
{ :limit => 10, :page => params[:page], :sort => 'updated_at' },
:include => :author)
Maintenance
Rebuilding the database
MyModel.ferret_rebuild
Shared or remote index
TODO: Uses DRb, ferreted.yml, ferreted-drb-daemon.rb. drb rails environment etc.