code: @Override
     public Scorer scorer(IndexReader reader, boolean scoreDocsInOrder, boolean topScorer) throws IOException
     {
        if (reader instanceof MultiIndexReader)
        {
           MultiIndexReader mir = (MultiIndexReader)reader;
           IndexReader[] readers = mir.getIndexReaders();
           int[] starts = new int[readers.length + 1];
           int maxDoc = 0;
           for (int i = 0; i < readers.length; i++)
           {
              starts[i] = maxDoc;
              maxDoc += readers[i].maxDoc();
           }
  
           starts[readers.length] = maxDoc;
           Scorer[] scorers = new Scorer[readers.length];
           for (int i = 0; i < readers.length; i++)
           {
              scorers[i] = scorer(readers[i], scoreDocsInOrder, topScorer);
           }
  
           return new MultiScorer(searcher.getSimilarity(), scorers, starts);
        }
        else
        {
           return createScorer(reader, scoreDocsInOrder, topScorer);
        }
     }
docs: {@inheritDoc}
  <br>
  Returns a {@link MultiScorer} if the passed <code>reader</code> is of
  type {@link MultiIndexReader}.