Class InstantiatedIndexReader
- java.lang.Object
-
- org.apache.lucene.index.IndexReader
-
- org.apache.lucene.store.instantiated.InstantiatedIndexReader
-
- All Implemented Interfaces:
Closeable,AutoCloseable,Cloneable
@Deprecated public class InstantiatedIndexReader extends org.apache.lucene.index.IndexReader
Deprecated.contrib/instantiated will be removed in 4.0; you can use the memory codec to hold all postings in RAMAn InstantiatedIndexReader is not a snapshot in time, it is completely in sync with the latest commit to the store!Consider using InstantiatedIndex as if it was immutable.
-
-
Constructor Summary
Constructors Constructor Description InstantiatedIndexReader(InstantiatedIndex index)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.apache.lucene.store.Directorydirectory()Deprecated.intdocFreq(org.apache.lucene.index.Term t)Deprecated.protected voiddoClose()Deprecated.protected voiddoCommit(Map<String,String> commitUserData)Deprecated.org.apache.lucene.document.Documentdocument(int n, org.apache.lucene.document.FieldSelector fieldSelector)Deprecated.Return theDocumentat thenth position.protected voiddoDelete(int docNum)Deprecated.protected voiddoSetNorm(int doc, String field, byte value)Deprecated.protected voiddoUndeleteAll()Deprecated.org.apache.lucene.index.FieldInfosgetFieldInfos()Deprecated.InstantiatedIndexgetIndex()Deprecated.org.apache.lucene.index.TermFreqVectorgetTermFreqVector(int docNumber, String field)Deprecated.voidgetTermFreqVector(int docNumber, String field, org.apache.lucene.index.TermVectorMapper mapper)Deprecated.voidgetTermFreqVector(int docNumber, org.apache.lucene.index.TermVectorMapper mapper)Deprecated.org.apache.lucene.index.TermFreqVector[]getTermFreqVectors(int docNumber)Deprecated.longgetVersion()Deprecated.An InstantiatedIndexReader is not a snapshot in time, it is completely in sync with the latest commit to the store!booleanhasDeletions()Deprecated.booleanisCurrent()Deprecated.An InstantiatedIndexReader is always current! Check whether this IndexReader is still using the current (i.e., most recently committed) version of the index.booleanisDeleted(int n)Deprecated.booleanisOptimized()Deprecated.intmaxDoc()Deprecated.byte[]norms(String field)Deprecated.never ever touch these values.voidnorms(String field, byte[] bytes, int offset)Deprecated.intnumDocs()Deprecated.org.apache.lucene.index.TermDocstermDocs()Deprecated.org.apache.lucene.index.TermDocstermDocs(org.apache.lucene.index.Term term)Deprecated.org.apache.lucene.index.TermPositionstermPositions()Deprecated.org.apache.lucene.index.TermEnumterms()Deprecated.org.apache.lucene.index.TermEnumterms(org.apache.lucene.index.Term t)Deprecated.-
Methods inherited from class org.apache.lucene.index.IndexReader
acquireWriteLock, addReaderClosedListener, clone, clone, close, commit, commit, decRef, deleteDocument, deleteDocuments, document, doOpenIfChanged, doOpenIfChanged, doOpenIfChanged, doOpenIfChanged, ensureOpen, flush, flush, getCommitUserData, getCommitUserData, getCoreCacheKey, getCurrentVersion, getDeletesCacheKey, getIndexCommit, getRefCount, getSequentialSubReaders, getTermInfosIndexDivisor, getUniqueTermCount, hasNorms, incRef, indexExists, lastModified, listCommits, numDeletedDocs, open, open, open, open, open, open, open, open, open, open, open, openIfChanged, openIfChanged, openIfChanged, openIfChanged, removeReaderClosedListener, reopen, reopen, reopen, reopen, setNorm, setNorm, termPositions, toString, tryIncRef, undeleteAll
-
-
-
-
Constructor Detail
-
InstantiatedIndexReader
public InstantiatedIndexReader(InstantiatedIndex index)
Deprecated.
-
-
Method Detail
-
isOptimized
@Deprecated public boolean isOptimized()
Deprecated.- Overrides:
isOptimizedin classorg.apache.lucene.index.IndexReader
-
getVersion
public long getVersion()
Deprecated.An InstantiatedIndexReader is not a snapshot in time, it is completely in sync with the latest commit to the store!- Overrides:
getVersionin classorg.apache.lucene.index.IndexReader- Returns:
- output from
InstantiatedIndex.getVersion()in associated instantiated index.
-
getFieldInfos
public org.apache.lucene.index.FieldInfos getFieldInfos()
Deprecated.- Specified by:
getFieldInfosin classorg.apache.lucene.index.IndexReader
-
directory
public org.apache.lucene.store.Directory directory()
Deprecated.- Overrides:
directoryin classorg.apache.lucene.index.IndexReader
-
isCurrent
public boolean isCurrent() throws IOExceptionDeprecated.An InstantiatedIndexReader is always current! Check whether this IndexReader is still using the current (i.e., most recently committed) version of the index. If a writer has committed any changes to the index since this reader was opened, this will returnfalse, in which case you must open a new IndexReader in order to see the changes. See the description of theautoCommitflag which controls when theIndexWriteractually commits changes to the index.- Overrides:
isCurrentin classorg.apache.lucene.index.IndexReader- Returns:
- always true
- Throws:
org.apache.lucene.index.CorruptIndexException- if the index is corruptIOException- if there is a low-level IO errorUnsupportedOperationException- unless overridden in subclass
-
getIndex
public InstantiatedIndex getIndex()
Deprecated.
-
numDocs
public int numDocs()
Deprecated.- Specified by:
numDocsin classorg.apache.lucene.index.IndexReader
-
maxDoc
public int maxDoc()
Deprecated.- Specified by:
maxDocin classorg.apache.lucene.index.IndexReader
-
hasDeletions
public boolean hasDeletions()
Deprecated.- Specified by:
hasDeletionsin classorg.apache.lucene.index.IndexReader
-
isDeleted
public boolean isDeleted(int n)
Deprecated.- Specified by:
isDeletedin classorg.apache.lucene.index.IndexReader
-
doDelete
protected void doDelete(int docNum) throws IOExceptionDeprecated.- Specified by:
doDeletein classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
doUndeleteAll
protected void doUndeleteAll() throws IOExceptionDeprecated.- Specified by:
doUndeleteAllin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
doCommit
protected void doCommit(Map<String,String> commitUserData) throws IOException
Deprecated.- Specified by:
doCommitin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
doClose
protected void doClose() throws IOExceptionDeprecated.- Specified by:
doClosein classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
document
public org.apache.lucene.document.Document document(int n, org.apache.lucene.document.FieldSelector fieldSelector) throws org.apache.lucene.index.CorruptIndexException, IOExceptionDeprecated.Return theDocumentat thenth position.Warning! The resulting document is the actual stored document instance and not a deserialized clone as retuned by an IndexReader over a
Directory. I.e., if you need to touch the document, clone it first!This can also be seen as a feature for live changes of stored values, but be careful! Adding a field with an name unknown to the index or to a field with previously no stored values will make
getFieldInfos()out of sync, causing problems for instance when merging the instantiated index to another index.This implementation ignores the field selector! All stored fields are always returned!
- Specified by:
documentin classorg.apache.lucene.index.IndexReader- Parameters:
n- document numberfieldSelector- ignored- Returns:
- The stored fields of the
Documentat the nth position - Throws:
org.apache.lucene.index.CorruptIndexException- if the index is corruptIOException- if there is a low-level IO error- See Also:
Fieldable,FieldSelector,SetBasedFieldSelector,LoadFirstFieldSelector
-
norms
public byte[] norms(String field) throws IOException
Deprecated.never ever touch these values. it is the true values, unless norms have been touched.- Specified by:
normsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
norms
public void norms(String field, byte[] bytes, int offset) throws IOException
Deprecated.- Specified by:
normsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
doSetNorm
protected void doSetNorm(int doc, String field, byte value) throws IOExceptionDeprecated.- Specified by:
doSetNormin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
docFreq
public int docFreq(org.apache.lucene.index.Term t) throws IOExceptionDeprecated.- Specified by:
docFreqin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
terms
public org.apache.lucene.index.TermEnum terms() throws IOExceptionDeprecated.- Specified by:
termsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
terms
public org.apache.lucene.index.TermEnum terms(org.apache.lucene.index.Term t) throws IOExceptionDeprecated.- Specified by:
termsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
termDocs
public org.apache.lucene.index.TermDocs termDocs() throws IOExceptionDeprecated.- Specified by:
termDocsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
termDocs
public org.apache.lucene.index.TermDocs termDocs(org.apache.lucene.index.Term term) throws IOExceptionDeprecated.- Overrides:
termDocsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
termPositions
public org.apache.lucene.index.TermPositions termPositions() throws IOExceptionDeprecated.- Specified by:
termPositionsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
getTermFreqVectors
public org.apache.lucene.index.TermFreqVector[] getTermFreqVectors(int docNumber) throws IOExceptionDeprecated.- Specified by:
getTermFreqVectorsin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
getTermFreqVector
public org.apache.lucene.index.TermFreqVector getTermFreqVector(int docNumber, String field) throws IOExceptionDeprecated.- Specified by:
getTermFreqVectorin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
getTermFreqVector
public void getTermFreqVector(int docNumber, String field, org.apache.lucene.index.TermVectorMapper mapper) throws IOExceptionDeprecated.- Specified by:
getTermFreqVectorin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
getTermFreqVector
public void getTermFreqVector(int docNumber, org.apache.lucene.index.TermVectorMapper mapper) throws IOExceptionDeprecated.- Specified by:
getTermFreqVectorin classorg.apache.lucene.index.IndexReader- Throws:
IOException
-
-