On Mon, Jun 25, 2007 at 03:39:57PM +0200, Stephen Heuer wrote:
> Hey,
> 
> > Be sure to apply the :store_classname => true option to all your
> > acts_as_ferret calls. Otherwise aaf cannot filter results by class.
> 
> Yep, I got :store_class_name => true in my models. The problem is 
> occurring when i do a search and i get back Person, EmailAddress, and 
> PhoneNumber objects that all match the query, but i only want back 
> Person objects. So, when i do a search for someone via their email i 
> don't want to get back an EmailAddress object and a Person Object, Just 
> the Person Object that the EmailAddress is Associated.

Well, if you only want to retrieve Person Objects from your index, then
just index Person objects in the first place :-)

Why don't you just index the email address right along with the Person?
Do you ever need to find a single EmailAddress object? If not, just
don't index them in their own index. Instead add a custom field to
Person's acts_as_ferred statement for the email address value.

Jens



-- 
Jens Krämer
webit! Gesellschaft für neue Medien mbH
Schnorrstraße 76 | 01069 Dresden
Telefon +49 351 46766-0 | Telefax +49 351 46766-66
[EMAIL PROTECTED] | www.webit.de
 
Amtsgericht Dresden | HRB 15422
GF Sven Haubold, Hagen Malessa
_______________________________________________
Ferret-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/ferret-talk

Reply via email to