# Acts\_as\_ferret - multi\_search problems

**URL:** <https://www.ruby-forum.com/t/acts-as-ferret-multi-search-problems/129730>\
**Category:** Ferret\
**Created:** [February 21, 2008, 3:57am UTC](https://www.ruby-forum.com/t/acts-as-ferret-multi-search-problems/129730 "2008-02-21T03:57:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [February 21, 2008, 3:57am UTC](https://www.ruby-forum.com/t/acts-as-ferret-multi-search-problems/129730/1 "2008-02-21T03:57:34Z")

</div>

I am usign the rails plugin acts\_as\_ferret. All my models have the  
following code:

acts\_as\_ferret :store\_class\_name =\> true

I am trying to search across 5 models, but I’m just testing with two for  
now. I have read all the other topics as best I can, but have not seen  
anyone with the same problem, or a solution that works.

In my search\_controller I have the following code:

@results = FilmSchool.multi\_search(params[:search\_query],  
[ProductionCompany])

I have been successful in using find\_by\_contents to return results from  
the FilmSchool model, and when I try and use multi\_search I get the  
following error in the browser:

undefined method `multi\_search’ for #Class:0x3708480

The trace looks like this:

vendor/rails/activerecord/lib/active\_record/base.rb:1532:in  
`method\_missing\_without\_paginate’

vendor/plugins/will\_paginate/lib/will\_paginate/finder.rb:93:in  
`method\_missing’

app/controllers/site/search\_controller.rb:4:in `search’

Am I missing something? Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![adamdorsey](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/ed8c4c/32.png) [@adamdorsey](https://www.ruby-forum.com/u/adamdorsey)\
**Post date:** [February 25, 2008, 1:51am UTC](https://www.ruby-forum.com/t/acts-as-ferret-multi-search-problems/129730/2 "2008-02-25T01:51:10Z")

</div>

Adam,

By now I figure you have already found the answer but here it is anyway.

multi\_search has been depreciated in favor of the :multi option for  
find\_by\_contents.

Specifically you would do something like this:  
@results = FilmSchool.find\_contents\_by(params[:search\_query],{:multi =\>  
[Class1, Class2, etc]})

I hope this helps!

Oh and make sure to rebuild your indexes if you added :store\_class\_name  
=\> true after they were created.
