I am trying to use acts_as_ferret's multi_search to search across
multiple models, but i only want it to return one type of model.
for example i have a page that lists out people. on this page it shows
email addresses and phone numbers. I want to be able to search by any
fields directly from the person model and search the fields from the
email_address and phone_number models, but I only want to get back
people.
person
has_many email_addresses
has_many phone_numbers
acts_as_ferret :fields => [:firstname, :lastname, :birth_date]
email_address
has_one person
acts_as_ferret :fields => [:email_address]
phone_number
has_one person
acts_as_ferret :fields => [:phone_number, :phone_type]
multi_search(options[:query], ["EmailAddress", "PhoneNumber"], {:limit
=> :all})
Is this the right way of doing this... or is there a better way?
--
Posted via http://www.ruby-forum.com/.
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk