Jens Krämer

Acts_as_ferret 0.2.1

 |  typo, ferret, ruby

As Kasper Weibel already pointed out, we’re proud to announce the release of the acts_as_ferret Rails plugin, version 0.2.1.

I’ve already mentioned the major new feature, the ability to run More Like This queries, in an earlier post. With those you can query your index for objects having similar contents like a given object.

Besides that, the biggest change is the switch from Ferret 0.3.2 to the 0.9 series as the suggested Ferret version to use. Until now, 0.9.x support was somewhat rough, this should be better now. Version 0.2.1 is meant to be fully compatible with Ferret 0.9 (this is valid for both the Ruby-only and the super fast C-version).

The last release of acts_as_ferret supporting Ferret 0.3.2 has been tagged as 0.2.0 in the SVN repository. Feature-wise both versions, 0.2.0 and 0.2.1, are equal.

In an effort to bring on some more documentation for acts_as_ferret, I detailed the steps I took to integrate Ferret into my Typo installation.

Comments

Adam

Thanks Jens for the update.

I have just started using acts_as_ferret and I am having difficulty in getting it filter records based on filter_options that I pass in.

Could you please provide an example of a working filter option in particular the find :condition parameter.

I have tried something like this

find_by_contents(query , :num_docs => 10, :conditions => ["site_id=?", @site.id])

But it does not work. All records are returned matching the search terms, but the condition is ignored.

Thanks,
Adam.

jk

Hi Adam,
Custom :conditions didn't work indeed, thanks for pointing this out. I just committed a small change to trunk to fix this.

Please note that find_by_contents actually takes two option hashes, the second carrying options intended for active record. So you should call it like that:

`find_by_contents(query, { :numdocs => 10 }, :conditions => ["site_id=?", @site.id])`