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
- 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)? - Do I need to set up table relationships to the others (has_many)?
- 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
Thanks again to Jens and the helpful people of this community. You rock!