On Mon, Sep 11, 2006 at 10:11:22PM +0200, Ian Zabel wrote:
> 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

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
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to