More_like_this not working?

Hi all,

using ferret 0.10.13 and aaf trunk, i cannot get more_like_this to work.
I read other posts on this forum related to that, but that did not solve
it.

I have a model Question with a field question_text. I do:


q = Question.find(:first)

q.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 /usr/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):8

q.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 /usr/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):9

q.more_like_this(:fields => [:question_text])
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 /usr/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):8


Am I doing something wrong or is this a bug?

On Fri, Dec 01, 2006 at 10:46:23AM +0100, Corné Verbruggen wrote:

q.more_like_this

you’ll have to give an array of field names to use for the similarity
search:

q.more_like_this :field_names => [ :question_text ]

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

Jens K. wrote:

On Fri, Dec 01, 2006 at 10:46:23AM +0100, Corn� Verbruggen wrote:

q.more_like_this

you’ll have to give an array of field names to use for the similarity
search:

q.more_like_this :field_names => [ :question_text ]

Jens

Thanks!