# Tutorial multi search with ferret?

**URL:** <https://www.ruby-forum.com/t/tutorial-multi-search-with-ferret/137617>\
**Category:** Ferret\
**Created:** [May 14, 2008, 5:54pm UTC](https://www.ruby-forum.com/t/tutorial-multi-search-with-ferret/137617 "2008-05-14T17:54:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![san1981](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@san1981](https://www.ruby-forum.com/u/san1981)\
**Post date:** [May 14, 2008, 5:54pm UTC](https://www.ruby-forum.com/t/tutorial-multi-search-with-ferret/137617/1 "2008-05-14T17:54:45Z")

</div>

Hello,

I would like to use the plugin act\_as\_ferret for a multiple search in  
different model, I’ve found some examples on web but only for one model.  
Does someone know a nice tutorial for search in multiple models?

Thanks in advance,

---

<div class="post-metadata">

**Author:** ![san1981](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ad7895/32.png) [@san1981](https://www.ruby-forum.com/u/san1981)\
**Post date:** [June 12, 2008, 3:12am UTC](https://www.ruby-forum.com/t/tutorial-multi-search-with-ferret/137617/2 "2008-06-12T03:12:58Z")

</div>

Hi, I don’t know of any, but here’s a quick example of what to put in  
your controller to get you started (you can also hack through the plugin  
code to work out how it does it):

#we want a paginated list of results for the view:  
@results = ActsAsFerret::find(params[:query],  
[Model1, Model2, Model3, Model4],  
#options  
{:page =\> params[:page], :per\_page =\> 10},  
#active record options (can be empty)  
{:conditions =\> {:model\_1 =\> “model 1 conditions”,  
:model\_2 =\> “model 2 conditions”  
}  
}  
)

san 1981 wrote:

> Hello,
> 
> I would like to use the plugin act\_as\_ferret for a multiple search in  
> different model, I’ve found some examples on web but only for one model.  
> Does someone know a nice tutorial for search in multiple models?
> 
> Thanks in advance,
