andrewpthorp wrote:
> Hello, I am basically asking how I can modify Sphinxes search configs
> to achieve this task:
> 
> model Contact has_may addresses and email_addresses
> 
> Contact.search( "Andrew", :per_page => 50, :page => 1, :star => true )
> will find anyone with first_name, last_name, company_name due to our
> setup :
> 
> define_index do
> indexes :first_name, :sortable => true
> end
> 
> What would be the best way to add the ability to search email address
> and address too, when the email_addresses in the database has a
> contact_id binding it to the contact?

So you want to be able to find contacts using their address or email
address? Thats a fairly standard TS setup. Without knowing the exact
names of of your model attributes, soemthing like this should work:

    define_index do
      indexes :first_name, :sortable => true
      indexes addresses.street
      indexes addresses.suburb
      indexes emails.address
    end

-- James Healy <[email protected]>  Fri, 14 May 2010 09:48:23 +1000

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to