We're currently indexing multiple models, and search across all of
them from a single page.  I'd like to be able to breakdown how many of
each model I found in the search results, but display the results from
a cross model search.  This lets our users click on one of the counts
to filter the search results to just that model.  I'm currently doing
this with multiple sphinx queries, but was wondering if anyone knew of
a better way to do it.  This is what I have:

@counts[:foo_model] = FooModel.search(params[:q]).total_entries
@counts[:bar_model] = BarModel.search(params[:q]).total_entries
@results = ThinkingSphinx::Search.search(params[:q])

Ideally, I'd just have to make the one call to the global search, and
be able to extract the counts for each model out of that.  Any help
appreciated,

Thanks,

Matt


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