Немного дополню.
через Sphinx php API это делается так (версия sphinx - 2.0.8 - linux):
$sphinx_obj->SetGroupBy("rubric_id", SPH_GROUPBY_ATTR, "@count desc");
$sphinx_obj->SetLimits(0, 100, 100);
$sphinx_obj->SetSelect('rubric_id, @count as items_count');
$search_res = $sphinx_obj->Query($query, 'catalog_index');
и такой результат:
[6345248] => Array
(
[weight] => 1
[attrs] => Array
(
[rubric_id] => 3763337
[@count] => 5
)
)
[3465352] => Array
(
[weight] => 1
[attrs] => Array
(
[rubric_id] => 3756960
[@count] => 2
)
)
В идеале достичь того же через SphinxQL