You can group two fields using the Pivot Facets which is available on the Solr 4.0.
You can run the following query on your index to get it.
http://localhost:8181/solr/collection1/select?q=*:*&facet=true&facet.pivot=field1,field2
Then, the result will be like :
<lst name="facet_pivot">
<arr name="field1,field2">
<lst>
<str name="field">field1</str>
<str name="value">A</str>
<int name="count">3</int>
<arr name="pivot">
<lst>
<str name="field">field2</str>
<str name="value">B</str>
<int name="count">2</int>
</lst>
<lst>
<str name="field">field2</str>
<str name="value">C</str>
<int name="count">1</int>
</lst>
</arr>
</lst>
<lst>
<str name="field">field1</str>
<str name="value">C</str>
<int name="count">3</int>
<arr name="pivot">
<lst>
<str name="field">field2</str>
<str name="value">D</str>
<int name="count">2</int>
</lst>
<lst>
<str name="field">field2</str>
<str name="value">B</str>
<int name="count">1</int>
</lst>
</arr>
</lst>
</arr>
</lst>