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.Directory
directory()
Deprecated.int
docFreq(org.apache.lucene.index.Term t)
Deprecated.protected void
doClose()
Deprecated.protected void
doCommit(Map<String,String> commitUserData)
Deprecated.org.apache.lucene.document.Document
document(int n, org.apache.lucene.document.FieldSelector fieldSelector)
Deprecated.Return theDocument
at then
th position.protected void
doDelete(int docNum)
Deprecated.protected void
doSetNorm(int doc, String field, byte value)
Deprecated.protected void
doUndeleteAll()
Deprecated.org.apache.lucene.index.FieldInfos
getFieldInfos()
Deprecated.InstantiatedIndex
getIndex()
Deprecated.org.apache.lucene.index.TermFreqVector
getTermFreqVector(int docNumber, String field)
Deprecated.void
getTermFreqVector(int docNumber, String field, org.apache.lucene.index.TermVectorMapper mapper)
Deprecated.void
getTermFreqVector(int docNumber, org.apache.lucene.index.TermVectorMapper mapper)
Deprecated.org.apache.lucene.index.TermFreqVector[]
getTermFreqVectors(int docNumber)
Deprecated.long
getVersion()
Deprecated.An InstantiatedIndexReader is not a snapshot in time, it is completely in sync with the latest commit to the store!boolean
hasDeletions()
Deprecated.boolean
isCurrent()
Deprecated.An InstantiatedIndexReader is always current! Check whether this IndexReader is still using the current (i.e., most recently committed) version of the index.boolean
isDeleted(int n)
Deprecated.boolean
isOptimized()
Deprecated.int
maxDoc()
Deprecated.byte[]
norms(String field)
Deprecated.never ever touch these values.void
norms(String field, byte[] bytes, int offset)
Deprecated.int
numDocs()
Deprecated.org.apache.lucene.index.TermDocs
termDocs()
Deprecated.org.apache.lucene.index.TermDocs
termDocs(org.apache.lucene.index.Term term)
Deprecated.org.apache.lucene.index.TermPositions
termPositions()
Deprecated.org.apache.lucene.index.TermEnum
terms()
Deprecated.org.apache.lucene.index.TermEnum
terms(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:
isOptimized
in 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:
getVersion
in 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:
getFieldInfos
in classorg.apache.lucene.index.IndexReader
-
directory
public org.apache.lucene.store.Directory directory()
Deprecated.- Overrides:
directory
in classorg.apache.lucene.index.IndexReader
-
isCurrent
public boolean isCurrent() throws IOException
Deprecated.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 theautoCommit
flag which controls when theIndexWriter
actually commits changes to the index.- Overrides:
isCurrent
in 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:
numDocs
in classorg.apache.lucene.index.IndexReader
-
maxDoc
public int maxDoc()
Deprecated.- Specified by:
maxDoc
in classorg.apache.lucene.index.IndexReader
-
hasDeletions
public boolean hasDeletions()
Deprecated.- Specified by:
hasDeletions
in classorg.apache.lucene.index.IndexReader
-
isDeleted
public boolean isDeleted(int n)
Deprecated.- Specified by:
isDeleted
in classorg.apache.lucene.index.IndexReader
-
doDelete
protected void doDelete(int docNum) throws IOException
Deprecated.- Specified by:
doDelete
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
doUndeleteAll
protected void doUndeleteAll() throws IOException
Deprecated.- Specified by:
doUndeleteAll
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
doCommit
protected void doCommit(Map<String,String> commitUserData) throws IOException
Deprecated.- Specified by:
doCommit
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
doClose
protected void doClose() throws IOException
Deprecated.- Specified by:
doClose
in 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, IOException
Deprecated.Return theDocument
at then
th 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:
document
in classorg.apache.lucene.index.IndexReader
- Parameters:
n
- document numberfieldSelector
- ignored- Returns:
- The stored fields of the
Document
at 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:
norms
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
norms
public void norms(String field, byte[] bytes, int offset) throws IOException
Deprecated.- Specified by:
norms
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
doSetNorm
protected void doSetNorm(int doc, String field, byte value) throws IOException
Deprecated.- Specified by:
doSetNorm
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
docFreq
public int docFreq(org.apache.lucene.index.Term t) throws IOException
Deprecated.- Specified by:
docFreq
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
terms
public org.apache.lucene.index.TermEnum terms() throws IOException
Deprecated.- Specified by:
terms
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
terms
public org.apache.lucene.index.TermEnum terms(org.apache.lucene.index.Term t) throws IOException
Deprecated.- Specified by:
terms
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
termDocs
public org.apache.lucene.index.TermDocs termDocs() throws IOException
Deprecated.- Specified by:
termDocs
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
termDocs
public org.apache.lucene.index.TermDocs termDocs(org.apache.lucene.index.Term term) throws IOException
Deprecated.- Overrides:
termDocs
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
termPositions
public org.apache.lucene.index.TermPositions termPositions() throws IOException
Deprecated.- Specified by:
termPositions
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
getTermFreqVectors
public org.apache.lucene.index.TermFreqVector[] getTermFreqVectors(int docNumber) throws IOException
Deprecated.- Specified by:
getTermFreqVectors
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
getTermFreqVector
public org.apache.lucene.index.TermFreqVector getTermFreqVector(int docNumber, String field) throws IOException
Deprecated.- Specified by:
getTermFreqVector
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
getTermFreqVector
public void getTermFreqVector(int docNumber, String field, org.apache.lucene.index.TermVectorMapper mapper) throws IOException
Deprecated.- Specified by:
getTermFreqVector
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
getTermFreqVector
public void getTermFreqVector(int docNumber, org.apache.lucene.index.TermVectorMapper mapper) throws IOException
Deprecated.- Specified by:
getTermFreqVector
in classorg.apache.lucene.index.IndexReader
- Throws:
IOException
-
-