Say I indexed the following from my database:
======================================
| Id | Code | Description |
=================================
The simplest way to achieve what you want is to use Solr grouping capabilities also called Field Collapsing. You would have to add the following parameters to your query:
group=true - that would turn on the grouping modulegroup.field=Code - that would tell Solr on which field the grouping should be donerows=10 - that would tell Solr to limit the number of unique groups to 10 at maxIf you would like to page through groups you should use the rows and start parameter. To control the results inside the groups themselves you would use group.limit and group.offset.
Hopefully that helps :)