Acts As Ferret plugin

Plugin details

This ActiveRecord mixin adds full text search capabilities to any Rails model.

Websitehttp://projects.jkraemer.net/acts_as_ferret/ Repositorysvn://projects.jkraemer.net/acts_as_ferret/trunk/plugin/acts_as_ferret Author Kasper Weibel Nielsen-Refs, Jens Kraemer Tags Search, Ferret LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install svn://projects.jkraemer.net/acts_as_ferret/trunk/plugin/acts_as_ferret

=== System-wide installation with Rubygems

sudo gem install acts_as_ferret



To use acts_as_ferret in your project, add the following line to your project's config/environment.rb:

require 'acts_as_ferret'




===Usage

include the following in your model class (specifiying the fields you want to get indexed):

acts_as_ferret :fields => [ :title, :description ]



now you can use ModelClass.find_by_contents(query) to find instances of your modelwhose indexed fields match a given query. All query terms are required by default, but explicit OR queries are possible. This differs from the ferret default, but imho is the more often needed/expected behaviour (more query terms result in less results).

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (1 older version) | Last edited by: Guest, 8 months ago