jkraemer / acts_as_ferret

Rails full text search plugin

This URL has Read+Write access

jkraemer (author)
Thu May 28 13:22:03 -0700 2009
commit  b38a8c09a095a9df674cd37a678acef47aa5d0db
tree    b5f54a06dc7cc81e1963ffc47cf288e5f560cf31
parent  a268f5c7b077b16a4ef4ab22ff89550564b5e6e7
acts_as_ferret / README
100644 79 lines (45 sloc) 2.495 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
= acts_as_ferret
 
This ActiveRecord mixin adds full text search capabilities to any Rails model.
 
It is heavily based on the original acts_as_ferret plugin done by
Kasper Weibel and a modified version done by Thomas Lockney, which
both can be found on http://ferret.davebalmain.com/trac/wiki/FerretOnRails
 
== Project Homepage
 
http://rm.jkraemer.net/projects/show/aaf
 
== Installation
 
Aaf is available via git from rubyforge.org and github.com. Github also offers
tarball downloads, check out http://github.com/jkraemer/acts_as_ferret/tree/master .
 
=== Installation inside your Rails > 2.1 project via gem management
 
Add this to your projects config/environment.rb:
 
<tt>config.gem 'acts_as_ferret', :version => '~> 0.4.4'</tt>
 
Or, use github:
 
<tt>config.gem 'jkraemer-acts_as_ferret', :version => '~> 0.4.4', :lib => 'acts_as_ferret', :source => 'http://gems.github.com'"</tt>
 
=== Installation inside your Rails project via script/plugin
 
script/plugin install git://github.com/jkraemer/acts_as_ferret.git
 
The rubyforge repository is located at git://rubyforge.org/actsasferret.git
 
=== Old SVN repository
 
In november 2008 I stopped updating the svn repository that has been the main
repository for aaf for several years. In case you want to retrieve any of the
older versions of the plugin, it's still there at
 
svn://code.jkraemer.net/acts_as_ferret/
 
=== System-wide installation with Rubygems
 
<tt>sudo gem install acts_as_ferret</tt>
 
To use acts_as_ferret in your project, add the following line to the end of your
project's config/environment.rb:
 
<tt>require 'acts_as_ferret'</tt>
 
Call the aaf_install script that came with the gem inside your project
directory to install the sample config file and the drb server start/stop
script.
 
 
== Usage
 
include the following in your model class (specifiying the fields you want to get indexed):
 
<tt>acts_as_ferret :fields => [ :title, :description ]</tt>
 
now you can use ModelClass.find_with_ferret(query) to find instances of your model
whose 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).
 
Please see ActsAsFerret::ActMethods#acts_as_ferret for more information.
 
== License
 
Released under the MIT license.
 
== Authors
 
* Kasper Weibel Nielsen-Refs (original author)
* Jens Kraemer <jk@jkraemer.net> (current maintainer)