Buggy code:
public class GroupedEndResultTransformer implements EndResultTransformer { private final SolrIndexSearcher searcher ; public GroupedEndResultTransformer ( SolrIndexSearcher searcher ) { } public void transform ( Map < String , ? > result , ResponseBuilder rb , SolrDocumentSource solrDocumentSource ) { NamedList < Object > commands = new NamedList < Object > ( ) ; for ( Map . Entry < String , ? > entry : result . entrySet ( ) ) { Object value = entry . getValue ( ) ; if ( TopGroups . class . isInstance ( value ) ) { @ SuppressWarnings ( "unchecked" ) TopGroups < BytesRef > topGroups = ( ( TopGroups < BytesRef > ) ( value ) ) ; NamedList < Object > command = new org . apache . solr . common . util . SimpleOrderedMap < Object > ( ) ; command . add ( "matches" , rb . totalHitCount ) ; Integer totalGroupCount = rb . mergedGroupCounts . get ( entry . getKey ( ) ) ; if ( totalGroupCount != null ) { command . add ( "ngroups" , totalGroupCount ) ; } List < NamedList > groups = new ArrayList < NamedList > ( ) ; SchemaField groupField = searcher . getSchema ( ) . getField ( entry . getKey ( ) ) ; FieldType groupFieldType = groupField . getType ( ) ; for ( GroupDocs < BytesRef > group : topGroups . groups ) { org . apache . solr . common . util . SimpleOrderedMap < Object > groupResult = new org . apache . solr . common . util . SimpleOrderedMap < Object > ( ) ; if ( ( group . groupValue ) != null ) { <START_BUG> groupResult . add ( "groupValue" , groupFieldType . toObject ( groupField . createField ( group . groupValue . utf8ToString ( ) , 0.0F ) ) ) ; <END_BUG> } else { groupResult . add ( "groupValue" , null ) ; } SolrDocumentList docList = new SolrDocumentList ( ) ; docList . setNumFound ( group . totalHits ) ; if ( ! ( Float . isNaN ( group . maxScore ) ) ) { docList . setMaxScore ( group . maxScore ) ; } docList . setStart ( rb . getGroupingSpec ( ) . getGroupOffset ( ) ) ; for ( ScoreDoc scoreDoc : group . scoreDocs ) { docList . add ( solrDocumentSource . retrieve ( scoreDoc ) ) ; } groupResult . add ( "doclist" , docList ) ; groups . add ( groupResult ) ; } command . add ( "groups" , groups ) ; commands . add ( entry . getKey ( ) , command ) ; } else if ( QueryCommandResult . class . isInstance ( value ) ) { QueryCommandResult queryCommandResult = ( ( QueryCommandResult ) ( value ) ) ; NamedList < Object > command = new org . apache . solr . common . util . SimpleOrderedMap < Object > ( ) ; command . add ( "matches" , queryCommandResult . getMatches ( ) ) ; SolrDocumentList docList = new SolrDocumentList ( ) ; docList . setNumFound ( queryCommandResult . getTopDocs ( ) . totalHits ) ; if ( ! ( Float . isNaN ( queryCommandResult . getTopDocs ( ) . getMaxScore ( ) ) ) ) { docList . setMaxScore ( queryCommandResult . getTopDocs ( ) . getMaxScore ( ) ) ; } docList . setStart ( rb . getGroupingSpec ( ) . getGroupOffset ( ) ) ; for ( ScoreDoc scoreDoc : queryCommandResult . getTopDocs ( ) . scoreDocs ) { docList . add ( solrDocumentSource . retrieve ( scoreDoc ) ) ; } command . add ( "doclist" , docList ) ; commands . add ( entry . getKey ( ) , command ) ; } } rb . rsp . add ( "grouped" , commands ) ; } }

Fix:
groupResult . add ( "groupValue" , groupFieldType . toObject ( groupField . createField ( group . groupValue . utf8ToString ( ) , 1.0F ) ) ) ;