On Thu, Jan 11, 2007 at 05:00:33PM +0100, Peter Jones wrote:
> I'm getting this exception from acts_as_ferret:
> 
> A RuntimeError occurred in search#similar:
> 
>   cannot determine document number from primary key:
> #<MyClass:0x9feba20>
>   [RAILS_ROOT]/vendor/plugins/acts_as_ferret/lib/instance_methods.rb:132:in
> `document_number'
> 
> As a result of this call:
> 
>   object.more_like_this
> 
> The relevant backtrace:
> 
>   [RAILS_ROOT]/vendor/plugins/acts_as_ferret/lib/instance_methods.rb:132:in
> `document_number'

the query to retrieve the document number is built in query_for_self
(also in instance_methods.rb). You could insert some debugging code to 
output that query and check if it looks right (e.g. by running it
manually against your index). It should return exactly one hit, matching
the record you're calling more_like_this on.

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