Buggy code:
public class QueryComponent extends SearchComponent { public static final String COMPONENT_NAME = "query" ; @ Override public void prepare ( ResponseBuilder rb ) throws IOException { } @ Override public void process ( ResponseBuilder rb ) throws IOException { } protected void doFieldSortValues ( ResponseBuilder rb , SolrIndexSearcher searcher ) throws IOException { SolrQueryRequest req = rb . req ; SolrQueryResponse rsp = rb . rsp ; boolean fsv = req . getParams ( ) . getBool ( FIELD_SORT_VALUES , false ) ; if ( fsv ) { Sort sort = rb . getSortSpec ( ) . getSort ( ) ; SortField [ ] sortFields = ( sort == null ) ? new SortField [ ] { SortField . FIELD_SCORE } : sort . getSort ( ) ; NamedList sortVals = new NamedList ( ) ; Field field = new Field ( "dummy" , "" , Store . YES , Index . NO ) ; SolrIndexReader reader = searcher . getReader ( ) ; SolrIndexReader [ ] readers = reader . getLeafReaders ( ) ; SolrIndexReader subReader = reader ; if ( ( readers . length ) == 1 ) { subReader = readers [ 0 ] ; readers = null ; } int [ ] offsets = reader . getLeafOffsets ( ) ; for ( SortField sortField : sortFields ) { int type = sortField . getType ( ) ; if ( ( type == ( SortField . SCORE ) ) || ( type == ( SortField . DOC ) ) ) continue ; FieldComparator comparator = null ; FieldComparator [ ] comparators = ( readers == null ) ? null : new FieldComparator [ readers . length ] ; String fieldname = sortField . getField ( ) ; FieldType ft = ( fieldname == null ) ? null : req . getSchema ( ) . getFieldTypeNoEx ( fieldname ) ; DocList docList = rb . getResults ( ) . docList ; ArrayList < Object > vals = new ArrayList < Object > ( docList . size ( ) ) ; DocIterator it = rb . getResults ( ) . docList . iterator ( ) ; int offset = 0 ; int idx = 0 ; while ( it . hasNext ( ) ) { int doc = it . nextDoc ( ) ; if ( readers != null ) { idx = SolrIndexReader . readerIndex ( doc , offsets ) ; subReader = readers [ idx ] ; offset = offsets [ idx ] ; comparator = comparators [ idx ] ; } if ( comparator == null ) { comparator = sortField . getComparator ( 1 , 0 ) ; <START_BUG> comparator . setNextReader ( subReader , offset ) ; <END_BUG> if ( comparators != null ) comparators [ idx ] = comparator ; } doc -= offset ; comparator . copy ( 0 , doc ) ; Object val = comparator . value ( 0 ) ; if ( val instanceof String ) { field . setValue ( ( ( String ) ( val ) ) ) ; val = ft . toObject ( field ) ; } if ( val instanceof BytesRef ) { field . setValue ( ( ( BytesRef ) ( val ) ) . utf8ToString ( ) ) ; val = ft . toObject ( field ) ; } vals . add ( val ) ; } sortVals . add ( fieldname , vals ) ; } rsp . add ( "sort_values" , sortVals ) ; } } protected void doPrefetch ( ResponseBuilder rb ) throws IOException { } @ Override public int distributedProcess ( ResponseBuilder rb ) throws IOException { } @ Override public void handleResponses ( ResponseBuilder rb , ShardRequest sreq ) { } @ Override public void finishStage ( ResponseBuilder rb ) { } private void createDistributedIdf ( ResponseBuilder rb ) { } private void createMainQuery ( ResponseBuilder rb ) { } private void mergeIds ( ResponseBuilder rb , ShardRequest sreq ) { } private void createRetrieveDocs ( ResponseBuilder rb ) { } private void returnFields ( ResponseBuilder rb , ShardRequest sreq ) { } @ Override public String getDescription ( ) { } @ Override public String getVersion ( ) { } @ Override public String getSourceId ( ) { } @ Override public String getSource ( ) { } @ Override public URL [ ] getDocs ( ) { } }

Fix:
comparator = comparator . setNextReader ( subReader , offset ) ;