Some answers inline,
On 10/9/06, bbqTree [email protected] wrote:
- from reading about ferret, do i still need to manually save the IDX
and add a IDX column field to my model table for acts_as_ferret to work?
they say that acts_as_ferret handles everything, but i wasnt sure what
exactly does it handle when compared to the ferret tutorials that i
You don’t need to index the id column of your AR-Model manually. AAF
take care of this automagically…
- is there a complete tutorial online for acts_as_ferret plugin? so far
all the blogs that i came across pretty much say the same thing.
don’t know. But the api docs of AAF should get you started…
- does acts_as_ferret do this? if i specify acts_as_ferret to index
just title column in my ‘recipe’ table, and if someone types ‘bbq plate’
in the search box, will these recipes with the following title match?
“island bbq style plate”
“potato plate salad”
“my bbq plate”
if so, will the one with the most matching text like “my bbq plate” be
listed as #1?
that depends. ferret has a sophisticated query parser. So imho it is up
you how you decide to handle the queries your users type in a box. IMHO
should parse the query string your user enters first. you might parse
usually used things like ‘AND’ and phrases ’ “” ’ and then translate
the query language of ferret:
‘sport:ski AND NOT sport:snowboard OR sport:toboggan’
‘ingredient:chocolate AND ingredient:strawberries AND NOT
You can set the default operator when you create the query parse.
There’s a method find_by_contents in AAF. The api says:
Finds instances by contents. Terms are ANDed by default, can be
by using OR between terms. options:
offset:first hit to retrieve (useful for paging) limit:number of hits
retrieve, or :all to retrieve all results
find_options is a hash passed on to active_record’s find when retrieving
data from db, useful to i.e. prefetch relationships.
this method returns a
which really is an Array that has been decorated with a
that delivers the total number of hits (including those not fetched
because of a low num_docs value).
Thanks for the help!