Forum: Ferret multi_search will not work

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3d3f3767a27bd842ce51a1ddd2159eb7?d=identicon&s=25 Craig Knox (Guest)
on 2006-05-26 05: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
end

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

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
suggestions.

Thanks
C9dd93aa135988cabf9183d3210665ca?d=identicon&s=25 Jens Kraemer (Guest)
on 2006-05-29 09:44
(Received via mailing list)
Hi Craig,

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

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

just a guess but this could work around the problem.

Cheers,
Jens

On Fri, May 26, 2006 at 05:21:19AM +0200, Craig Knox wrote:
>
>
> Ferret-talk@rubyforge.org
> http://rubyforge.org/mailman/listinfo/ferret-talk

--
webit! Gesellschaft für neue Medien mbH          www.webit.de
Dipl.-Wirtschaftsingenieur Jens Krämer       kraemer@webit.de
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.