org.opencms.search
Class CmsSearchIndex.LazyContentReader

java.lang.Object
  extended by org.apache.lucene.index.IndexReader
      extended by org.apache.lucene.index.FilterIndexReader
          extended by org.opencms.search.CmsSearchIndex.LazyContentReader
Enclosing class:
CmsSearchIndex

protected class CmsSearchIndex.LazyContentReader
extends org.apache.lucene.index.FilterIndexReader

Lucene filter index reader implementation that will ensure the OpenCms default search index fields CmsSearchField.FIELD_CONTENT and CmsSearchField.FIELD_CONTENT_BLOB are lazy loaded.

This is to optimize performance - these 2 fields will be rather large especially for extracted binary documents like PDF, MS Office etc. By using lazy fields the data is only read when it is actually used.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.lucene.index.FilterIndexReader
org.apache.lucene.index.FilterIndexReader.FilterTermDocs, org.apache.lucene.index.FilterIndexReader.FilterTermEnum, org.apache.lucene.index.FilterIndexReader.FilterTermPositions
 
Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader
org.apache.lucene.index.IndexReader.FieldOption
 
Field Summary
 
Fields inherited from class org.apache.lucene.index.FilterIndexReader
in
 
Fields inherited from class org.apache.lucene.index.IndexReader
hasChanges
 
Constructor Summary
CmsSearchIndex.LazyContentReader(org.apache.lucene.index.IndexReader indexReader)
          Create a new lazy content reader.
 
Method Summary
 org.apache.lucene.document.Document document(int n)
           
 
Methods inherited from class org.apache.lucene.index.FilterIndexReader
directory, docFreq, doClose, doCommit, document, doDelete, doSetNorm, doUndeleteAll, getFieldNames, getTermFreqVector, getTermFreqVector, getTermFreqVector, getTermFreqVectors, getVersion, hasDeletions, hasNorms, isCurrent, isDeleted, isOptimized, maxDoc, norms, norms, numDocs, termDocs, termPositions, terms, terms
 
Methods inherited from class org.apache.lucene.index.IndexReader
acquireWriteLock, close, commit, decRef, deleteDocument, deleteDocuments, ensureOpen, flush, getCurrentVersion, getCurrentVersion, getCurrentVersion, getIndexCommit, getTermInfosIndexDivisor, incRef, indexExists, indexExists, indexExists, isLocked, isLocked, lastModified, lastModified, lastModified, listCommits, main, numDeletedDocs, open, open, open, open, open, open, open, open, open, reopen, setNorm, setNorm, setTermInfosIndexDivisor, termDocs, termPositions, undeleteAll, unlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmsSearchIndex.LazyContentReader

public CmsSearchIndex.LazyContentReader(org.apache.lucene.index.IndexReader indexReader)
Create a new lazy content reader.

Parameters:
indexReader - the index reader to use this lazy content reader with
Method Detail

document

public org.apache.lucene.document.Document document(int n)
                                             throws org.apache.lucene.index.CorruptIndexException,
                                                    java.io.IOException
Overrides:
document in class org.apache.lucene.index.IndexReader
Throws:
org.apache.lucene.index.CorruptIndexException
java.io.IOException
See Also:
IndexReader.document(int)