Forum: Ferret multi_search will not work

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Craig Knox (Guest)
on 2006-05-26 07:21
I am trying to get multi_search to search across multiple models.  I
have the following:

class Drug < ActiveRecord::Base
  acts_as_ferret :store_class_name => true

class Target < ActiveRecord::Base
  acts_as_ferret :store_class_name => true

and I am trying to query via:
@drugs = Drug.multi_search(params[:query], [Target])

But I get no results.  If I go:
@drugs = Drug.find_by_contents(params[:query])

I get results back no problem (same if I just query the target), but
even after I delete the index and rebuild both the drug and target index
I get nothing back.  I don't even get any results if I go:
@drugs = Drug.multi_search(params[:query])

 I have tried this with the latest trunk build and the latest stable
version.  I am really at a loss, and was hoping someone might have some

Jens K. (Guest)
on 2006-05-29 11:44
(Received via mailing list)
Hi Craig,

could you please try to explicitly state the fields you want to index,

acts_as_ferret(:fiels => [ 'content', 'extended_content' ],
               :store_class_name => true)

just a guess but this could work around the problem.


On Fri, May 26, 2006 at 05:21:19AM +0200, Craig Knox wrote:
> removed_email_address@domain.invalid

webit! Gesellschaft für neue Medien mbH
Dipl.-Wirtschaftsingenieur Jens Krämer 
Schnorrstraße 76                         Tel +49 351 46766  0
D-01069 Dresden                          Fax +49 351 46766 66
This topic is locked and can not be replied to.