I accepted the hross answer, but you can also do something similar in Solr 1.3 and higher using:
/select?q={!func}map(Category,20,20,1,0)&sort=score desc
The most interesting thing is that you can sort by other fields, therefore:
&sort=score desc, name asc
source share