Say I indexed the following from my database:
====================================== | Id | Code | Description | =================================
Have a look at field collapsing, available in Solr 4.0. Sorting groups on relevance: group.sort=score desc.
group.sort=score desc