[ANN] acts_as_ferret 0.3.0

Hi,

just wanted to officially announce the release of acts_as_Ferret 0.3.0.
As you see, I’m trying to catch up with Ferret’s version numbers :wink:

svn://projects.jkraemer.net/acts_as_ferret/tags/0.3.0/
or
svn://projects.jkraemer.net/acts_as_ferret/tags/stable/

This release is now tagged stable, so in case anybody has used the old
stable release via an svn external, please switch over to the 0.2.3 tag
at svn://projects.jkraemer.net/acts_as_ferret/tags/0.2.3/

Besides the switch to the shiny new 0.10 API, there are two new
features:

  • Match highlighting through Ferret’s highlight method, with even more
    convenience added :wink:

highlight = record.highlight(‘test’)

will by default scan all stored fields of this record for highlight
matches. However this can be turned off on the field level in case
you don’t want to get highlights out of a field you stored for other
reasons by specifying :highlight => :no as an option to acts_as_ferret.

This method takes the same options as the Ferret::Index::Index#highlight
one. If you only want to get highlights from exactly one field, just
specify it with the :field option.

  • It’s now possible to turn off the automatic indexing for the next or
    all following calls to #save. You can even give a block that should be
    executed without indexing, and optionally have aaf index your record
    after the whole block is finished. Please see
    http://projects.jkraemer.net/acts_as_ferret/wiki/AdvancedUsage for
    usage notes.

  • no new feature, but didn’t work until now with 0.10.x - the
    more_like_this instance method now works as expected again.

have fun!

Jens


webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [email protected]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66

Thanks for the update, Jens!

How can I get more_like_this to work? Do I have to have my fields
stored?

I’m getting this error when I try to run it with fields stored or not:

t = Topic.find(:first)
t.more_like_this
NoMethodError: You have a nil object when you didn’t expect it!
You might have expected an instance of Array.
The error occured while evaluating nil.each
from
./script/…/config/…/config/…/vendor/plugins/acts_as_ferret/lib/more_like_this.rb:110:in
retrieve_terms' from ./script/../config/../config/../vendor/plugins/acts_as_ferret/lib/more_like_this.rb:65:inmore_like_this’
from c:/ruby/lib/ruby/1.8/monitor.rb:229:in synchronize' from ./script/../config/../config/../vendor/plugins/acts_as_ferret/lib/more_like_this.rb:61:inmore_like_this’
from (irb):4

This is aaf trunk and ferret 0.10.4

On Mon, Sep 11, 2006 at 10:11:22PM +0200, Ian Z. wrote:

You might have expected an instance of Array.
The error occured while evaluating nil.each

oh, you’ll have to specify an array of the fields you want to use for
the similarity search:

t.more_like_this(:fields => [ :content, :title ])

The query that is constructed to find similar topics will then be built
from relevant terms found in those fields of t.

more_like_this doesn’t need stored field contents, it even can work
without term vectors in the index, In this case it takes the contents
from the db and builds the term information on the fly. ferret’s term
vectors will be much faster than that, of course. Stored Term vectors
are the default with aaf, so no need to worry about that.

cheers,
Jens


webit! Gesellschaft für neue Medien mbH www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer [email protected]
Schnorrstraße 76 Tel +49 351 46766 0
D-01069 Dresden Fax +49 351 46766 66