acts_as_ferret 0.4.3
Long time since the last release (not counting the short-lived 0.4.2 …), and I guess most people already use trunk anyway, but for the faint of heart, here’s the new stable version of your favourite Rails fulltext search plugin.
As always, get it via svn from svn://projects.jkraemer.net/acts_as_ferret/tags/stable/acts_as_ferret
. More installation information can be found on the acts_as_ferret Trac site.
No big news feature-wise, I already wrote about the more important features when I added them to trunk:
Going through the timeline looking for some cool feature I didn’t already write about I found several smaller things worth mentioning:
Dynamic document specific boosts
This comes in handy if you want to have search results automatically ranked by a criteria which is different for each record, e.g. the popularity of an article in your shop:
class Article
acts_as_ferret :boost => :popularity
def popularity
# return dynamic boost value for this document
end
end
You may also apply the dynamic boost to a specific field (or even different boosts to different fields), so it only is applied when a hit occurs in the boosted field. This way you can choose at query time if you want to have the boosting applied or not. Just query either the boosted fields, or the normal ones:
class Article
acts_as_ferret :fields => {
:title => {},
:boosted_title => { :boost => :rating }
}
def rating
# return rating of this article
end
# value for the boosted title field def boosted_title title end end </code>
New and better start/stop scripts
The DRb server now has a unified start/stop script and it ships with scripts for using the it as a Windows system service. Thanks to Peter Jones and Herryanto Siatono for contributing these.
Also the acts_as_ferret gem now has got an installer that will install the server script and sample config into your Rails project:
$ gem install acts_as_ferret
$ rails test
$ cd test/
$ aaf_install
$ script/ferret_server -e production start
And your DRb server is up and running. Easy, isn’t it?
No more :remote => true
Last but not least, aaf now is a bit more clever and goes into remote mode automatically if the DRb server is configured for the current environment. If for whatever reason you don’t want that, use :remote => false
.
Comments
David
jk
Esti
require(File.join(File.dirname(__FILE__), '../../../../config/environment'))
and commenting line 47
require(File.join(File.dirname(ENV['_']), '../config/environment'))
Is that ok?
Thanks!
jk
roger pack
ruby c:\ruby_mingw2\bin\aaf_install
to get it to install
HOWEVER it doesn't seem to really work still. Looking into it.
roger pack
means 'update your ferret/acts_as_ferret gems' (on osx, at least)...