Buggy code:
public class LukeRequestHandler extends RequestHandlerBase { private static Logger log = LoggerFactory . getLogger ( LukeRequestHandler . class ) ; public static final String NUMTERMS = "numTerms" ; public static final String DOC_ID = "docId" ; public static final String ID = "id" ; public static final int DEFAULT_COUNT = 10 ; static final int HIST_ARRAY_SIZE = 33 ; private static enum ShowStyle { ALL , DOC , SCHEMA , INDEX ; public static LukeRequestHandler . ShowStyle get ( String v ) { } } @ Override public void handleRequestBody ( SolrQueryRequest req , SolrQueryResponse rsp ) throws Exception { } private static String getFieldFlags ( IndexableField f ) { } private static String getFieldFlags ( SchemaField f ) { } public static SimpleOrderedMap < String > getFieldFlagsKey ( ) { } private static SimpleOrderedMap < Object > getDocumentFieldsInfo ( Document doc , int docId , IndexReader reader , IndexSchema schema ) throws IOException { } private static SimpleOrderedMap < Object > getIndexedFieldsInfo ( SolrQueryRequest req ) throws Exception { } private static Document getFirstLiveDoc ( AtomicReader reader , String fieldName , Terms terms ) throws IOException { DocsEnum docsEnum = null ; TermsEnum termsEnum = terms . iterator ( null ) ; BytesRef text ; for ( int idx = 0 ; ( idx < 1000 ) && ( docsEnum == null ) ; ++ idx ) { text = termsEnum . next ( ) ; if ( text == null ) { return null ; } Term term = new Term ( fieldName , text ) ; <START_BUG> docsEnum = reader . termDocsEnum ( reader . getLiveDocs ( ) , term . field ( ) , new BytesRef ( term . text ( ) ) , 0 ) ; <END_BUG> if ( docsEnum != null ) { int docId ; if ( ( docId = docsEnum . nextDoc ( ) ) != ( DocIdSetIterator . NO_MORE_DOCS ) ) { return reader . document ( docId ) ; } } } return null ; } private static SimpleOrderedMap < Object > getSchemaInfo ( IndexSchema schema ) { } private static SimpleOrderedMap < Object > getAnalyzerInfo ( Analyzer analyzer ) { } private static void populateFieldInfo ( IndexSchema schema , Map < String , List < String > > typeusemap , Map < String , Object > fields , SchemaField uniqueField , SchemaField f ) { } public static SimpleOrderedMap < Object > getIndexInfo ( DirectoryReader reader , boolean detail ) throws IOException { } public static SimpleOrderedMap < Object > getIndexInfo ( DirectoryReader reader ) throws IOException { } @ SuppressWarnings ( "unchecked" ) private static void getDetailedFieldInfo ( SolrQueryRequest req , String field , SimpleOrderedMap < Object > fieldMap ) throws IOException { } @ Override public String getDescription ( ) { } @ Override public String getSource ( ) { } @ Override public URL [ ] getDocs ( ) { } static class TermHistogram { int _maxBucket = - 1 ; int [ ] _buckets = new int [ LukeRequestHandler . HIST_ARRAY_SIZE ] ; public void add ( int [ ] buckets ) { } public NamedList < Integer > toNamedList ( ) { } } private static class TopTermQueue extends PriorityQueue { static class TermInfo { TermInfo ( Term t , int df ) { } int docFreq ; Term term ; } public int minFreq = 0 ; public int distinctTerms = 0 ; public LukeRequestHandler . TermHistogram histogram ; TopTermQueue ( int size ) { } @ Override protected final boolean lessThan ( Object a , Object b ) { } public NamedList < Integer > toNamedList ( IndexSchema schema ) { } public LukeRequestHandler . TopTermQueue . TermInfo getTopTermInfo ( ) { } } }

Fix:
docsEnum = reader . termDocsEnum ( reader . getLiveDocs ( ) , term . field ( ) , new BytesRef ( term . text ( ) ) , false ) ;