To be honest, I don't think this is possible with Sphinx - unless there's some 
way of getting that aggregate count value without actually using Sphinx's 
grouping functionality?

Maybe worth asking on the Sphinx forum:
http://sphinxsearch.com/forum/

-- 
Pat

On 09/07/2012, at 1:01 AM, Neil Panjwani wrote:

> I'm trying to use Thinking Sphinx in Rails to search for products, grouped by 
> categories. I want to sort the categories based on the count, i.e. how many 
> products are found in that category. Thinking Sphinx's docs say I can do this:
> 
> A Product belongs to a Category and a Category has many Products.
> 
> Product.search 'cheese'
>  :group_by       => 'category_id',
>  :group_function => :attr,
>  :group_clause   => "@count desc"
> 
> But this only returns 1 matched item PER category. How can I return all 
> matches within a category, while still sorting by count within the categories?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To view this discussion on the web visit 
> https://groups.google.com/d/msg/thinking-sphinx/-/sW0IXtnLpBAJ.
> 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.

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