Ok so i have a graphic model and I am using thinking sphinx as the search tool. It works well but i want to display different models on the search results page.. for example
i have this in my Graphic model
define_index do
indexes :name, :description, :scale,
indexes sub_category.name, :as => :subcategory_name
indexes sub_category.category.name, :as => :category_name
indexes colors.name, :as => :color_name
end
This is fine and good but the problem is i want to display all the categories and subcategories for a found search and not just the graphics that are related. In my controller should i have three find like
@graphics = Graphic.search params[:search]
@categories = Categories.search params[:search]
@sub_categories = SubCategories.search params[:search]
this seems like overkill...is there a better way so in the view i can show each of them seperately