Returns default index reader.

@return index reader.
180590
private IndexReader getIndexReader()
    {
        // removed flushInternal() call while reading
        if (reader == null)
        {
            try
            {
                if (!isInitialized)
                {
                    Directory sourceDir = FSDirectory.open(getIndexDirectory().toPath());
                    copy(sourceDir, index);
                    isInitialized = true;
                }
                reader = DirectoryReader.open(index);
            }
            catch (IndexNotFoundException infex)
            {
                log.warn("No index found in given directory, caused by:", infex.getMessage());
            }
            catch (Exception e)
            {
                log.error("Error while instantiating LuceneIndexer, Caused by :.", e);
                throw new LuceneIndexingException(e);
            }
        }
        return reader;
    }
486088
protected function getReader()
    {
        if (!isset($this->readers[$this->type])) {
            throw new OutOfBoundsException($this->translate(
                'Reader "{type}" is not available.',
                ['type' => $this->type]
            ));
        }

        return $this->getPrototype($this->readers[$this->type], ['umi\config\io\reader\IReader'])->createSingleInstance();
    }
15012
public function getReadHandler()
    {
        if (null === $this->stream) {
            $this->stream = fopen($this->uri, 'r');
        }
        return $this->stream;
    }
866702
@Override
    public BufferedReader getReader() throws IOException {
        try {
            collaborator.preInvoke(componentMetaData);
            return request.getReader();
        } finally {
            collaborator.postInvoke();
        }
    }
83344
@Deprecated
  public OIndex<?> getIndex() {
    Set<OIndex<?>> indexes = owner.getInvolvedIndexes(name);
    if (indexes != null && !indexes.isEmpty())
      return indexes.iterator().next();
    return null;
  }
338596
public String getReadMethod() {
    	if ( getterName != null ) {
    		return getterName;
	    }
        String prefix;
        if ( "boolean".equals( this.type ) ) {
            prefix = "is";
        } else {
            prefix = "get";
        }
        return prefix + this.name.substring( 0,
                1 ).toUpperCase() + this.name.substring( 1 );
    }
482713
public int middleIndex()
  {
    int x = midPoint();
    int r = rightMostIndex();
    if (r < midPoint())
      x = r;
    return x;
  }
409890
public Reader openReader() throws FetchException {
        try {
            return getInternalClobForFetch().getCharacterStream();
        } catch (SQLException e) {
            throw mRepo.toFetchException(e);
        }
    }
194262
public String[] getIndexArr() {
		String[] indexArr = new String[this.from.size()];
		for (int i = 0; i < indexArr.length; i++) {
			indexArr[i] = this.from.get(i).getIndex();
		}
		return indexArr;
	}
1018155
private function getIndex()
    {
        $indexName = $this->readBaseConfigParam('index');

        return $this->indexManager->getIndexByName($indexName, $this->storeId);
    }
738303
public function getIndex() : ?int 
    {
        if ( ! $this->hasIndex()) {
            $this->setIndex($this->getDefaultIndex());
        }
        return $this->index;
    }
354051
protected final int readerIndex(int n)
   {
      int lo = 0;
      int hi = readers.size() - 1;

      while (hi >= lo)
      {
         int mid = (lo + hi) >> 1;
         int midValue = starts[mid];
         if (n < midValue)
         {
            hi = mid - 1;
         }
         else if (n > midValue)
         {
            lo = mid + 1;
         }
         else
         {
            while (mid + 1 < readers.size() && starts[mid + 1] == midValue)
            {
               mid++;
            }
            return mid;
         }
      }
      return hi;
   }
854747
public function getIndex() : ?string 
    {
        if ( ! $this->hasIndex()) {
            $this->setIndex($this->getDefaultIndex());
        }
        return $this->index;
    }
1032386
public ReadStream openRead()
    throws IOException
  {
    if (_isDone)
      return null;
    else if (_readStream == null)
      _readStream = new ReadStream(this);
    else if (!_isPartDone) {
      int len;
      while ((len = read(_dummyBuffer, 0, _dummyBuffer.length)) >= 0) {
      }

      if (_isDone)
        return null;
    }

    _readStream.init(this);

    _isPartDone = false;

    if (scanHeaders()) {
      String contentType = (String) getAttribute("content-type");

      String charset = getAttributePart(contentType, "charset");

      // FIXME: 2016-05-14 
/*
      if (charset != null)
        _readStream.setEncoding(charset);
      else if (_defaultEncoding != null)
        _readStream.setEncoding(_defaultEncoding);
*/

      return _readStream;
    }
    else {
      _isDone = true;
      _readStream.close();
      return null;
    }
  }
141061
@Pure
	protected DBaseFileReader getReader() throws IOException {
		if (this.reader == null) {
			this.reader = new DBaseFileReader(this.url.openStream());
			this.reader.readDBFHeader();
			this.reader.readDBFFields();
		}
		return this.reader;
	}
1374359
@Override
    protected RDBMSEntityReader getReader()
    {
        if (reader == null)
        {
            reader = new RDBMSEntityReader(getJPAQuery(), kunderaQuery, kunderaMetadata);
        }
        return reader;
    }
370563
public STRtree readIndex() throws Exception {

        File file = new File(path);
        raf = new RandomAccessFile(file, "r");

        raf.seek(6L);
        checkVersions();

        long position = INDEX_ADDRESS_POSITION;
        raf.seek(position);
        long indexAddress = raf.readLong();
        position = INDEX_ADDRESS_POSITION + INDEX_ADDRESS_SIZE;
        raf.seek(position);
        long indexSize = raf.readLong();

        raf.seek(indexAddress);
        byte[] indexBytes = new byte[(int) indexSize];
        int read = raf.read(indexBytes);
        if (read != indexSize) {
            throw new IOException();
        }

        ObjectInputStream in = new ObjectInputStream(new ByteArrayInputStream(indexBytes));
        indexObj = (STRtree) in.readObject();
        return indexObj;
    }