@search = Sunspot.search(Event, Person, Organization) do
keywords params[:q]
order_by(:score)
end
Based on the search results I'd like to create a list of Models with counts for each model.
- Events (12)
- People (5)
- Organizations (3)
Is there a way to do this type of grouping in Sunspot?
<% @search.each_hit_with_result do |hit, result| -%>
<%= result.class %> <!- Gives me Model, but repeated -->
<% end %>