code: protected IndexReader getIndexReader(boolean includeSystemIndex) throws IOException
     {
        // deny query execution if index in offline mode and allowQuery is false
        if (!indexRegister.getDefaultIndex().isOnline() && !allowQuery.get())
        {
           throw new IndexOfflineIOException("Index is offline");
        }
        QueryHandler parentHandler = getContext().getParentHandler();
        CachingMultiIndexReader parentReader = null;
        if (parentHandler instanceof SearchIndex && includeSystemIndex)
        {
           parentReader = ((SearchIndex)parentHandler).indexRegister.getDefaultIndex().getIndexReader();
        }
  
        IndexReader reader;
        if (parentReader != null)
        {
           CachingMultiIndexReader[] readers = {indexRegister.getDefaultIndex().getIndexReader(), parentReader};
           reader = new CombinedIndexReader(readers);
        }
        else
        {
           reader = indexRegister.getDefaultIndex().getIndexReader();
        }
        return new JcrIndexReader(reader);
     }
docs: Returns an index reader for this search index. The caller of this method
  is responsible for closing the index reader when he is finished using it.
  
  @param includeSystemIndex
  if <code>true</code> the index reader will cover the complete
  workspace. If <code>false</code> the returned index reader
  will not contains any nodes under /jcr:system.
  @return an index reader for this search index.
  @throws IOException
  the index reader cannot be obtained.