Hello everybody,
 I have two models named Organization and Employee with following
relation.

class Organization < ActiveRecord::Base
  has_many :employees
     define_index do
    #sphinx fields
    indexes title
    indexes adress
    indexes employees.name,:as => :emp_name
    indexes employees.designation,:as => :emp_designation
  end
end

When i try to search for the results that match the list of all the
employees that belongs to the organization,
i successfully achieved in displaying the organization search results
but i want to display the employee name and designation under a
particular organization. How should i iterate to achieve this in my
view file?

This was my query

 @organizations = Organization.search('Smith',:page => params
[:page], :per_page =>2,:excerpts => true)

Where Smith is the employee name.

I have the more number of employees with the same name.

When i search for Smith, i want to achieve the results of all the
names and designations of Smith under various Organizations.

Hope someone would help me out in solving this problem.

Thanks in advance.

-- 
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