I have looked around a bit and I can't seem to find anything on the best way to do this. Basically, I have sunspot search that I am using to search across multiple model types. The search works fine and looks something like this:
@search = Sunspot.search(Blogpost,Employee) do fulltext 'showcase OR dan' end
It returns multiple object from different models, for example:
@search.hits
=> [#<Sunspot::Search::Hit:Employee 645114968>, #<Sunspot::Search::Hit:Blogpost 980190967>, #<Sunspot::Search::Hit:Blogpost 980190970>]
The search hits are of type: Sunspot::Search::PaginatedCollection
What I'd like to be able to do is provide summary count information for this data, for example, "there are two blogposts and one employee". Is there any way to sum the counts of each object type in this collection? I appreciate you taking the time to help me.
..HOPE IT HELPS