# MultiSearch and ActionView Questions

**URL:** <https://www.ruby-forum.com/t/multisearch-and-actionview-questions/91569>\
**Category:** Ferret\
**Created:** [April 10, 2007, 4:08pm UTC](https://www.ruby-forum.com/t/multisearch-and-actionview-questions/91569 "2007-04-10T16:08:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pimpmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pimpmaster](https://www.ruby-forum.com/u/pimpmaster)\
**Post date:** [April 10, 2007, 4:08pm UTC](https://www.ruby-forum.com/t/multisearch-and-actionview-questions/91569/1 "2007-04-10T16:08:16Z")

</div>

Hey all,

I had some pressing questions about acts\_as\_ferret and had not heard  
about this mailing list yet, so I contacted Jens directly and he was  
kind enough  
to answer my questions. I would like to post our exchange here and  
continue the dialogue in hopes that it’s useful to someone else out  
there.

Question #1:  
How should I be setting up my form helper?

> > Jens’ Response:  
> > There’s nothing special to do here - just use a normal text\_field.  
> > I usually have a separate Search model class to back my search  
> > forms.

Question #2:  
Rather than defining self.full\_text\_search on each of my 12 models, I  
am hoping for a cleaner solution, perhaps a module that I can mixin  
somehow. Also I am pondering the idea of having a separate  
SearchController so that my search methods are in one place as well.  
Do you have any guides/suggestions for handling multiple models in a  
DRY fashion?

> > Jens’ Response:  
> > See above, either create one Search model to handle all searches,  
> > or use  
> > inheritance/mix ins to handle the common things like paging.  
> > Depends on  
> > how your search forms look - if they’re all the same one Search  
> > model  
> > should be enough - just parametrize it with the class you want to  
> > search  
> > on.

Question #3:  
Where exactly does AAF keep the generated index?

> > Jens’ Response:  
> > By default aaf creates the indices in directories named  
> > RAILS\_ROOT/index/RAILS\_ENV/model\_name.

################ NEW QUESTIONS ###################

Re: Search Model

1. Is this just an Active Record object or do I need to set up a  
database for it as well (if so then with what columns)?
2. Do I need to set up table relationships to the others (has\_many)?
3. How do I boost fields within a multisearch statement?

Re: Search Display

I’ve seen countless examples of pagination code for AAF, but Im still  
not sure how to write the view code for my search results. You can  
read more about the issues I am having, along with code examples here  
=\> [Parked at Loopia](http://pastie.caboo.se/52769)

Thanks again to Jens and the helpful people of this community. You rock!

---

<div class="post-metadata">

**Author:** ![pimpmaster](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b9e5f3/32.png) [@pimpmaster](https://www.ruby-forum.com/u/pimpmaster)\
**Post date:** [April 10, 2007, 4:29pm UTC](https://www.ruby-forum.com/t/multisearch-and-actionview-questions/91569/2 "2007-04-10T16:29:18Z")

</div>

Sorry about the double-post yall. I am pretty new to this stuff.

You can also disregard my previous query on the search results. I  
made the silly mistake of using form\_for instead of form\_tag, but  
have remedied that.

I look forward to learning how to use this amazing software properly.  
Thanks for your time 🙂
