public class InstantiatedIndexReader extends IndexReader
Consider using InstantiatedIndex as if it was immutable.
IndexReader.FieldOptionhasChanges| Constructor and Description |
|---|
InstantiatedIndexReader(InstantiatedIndex index) |
| Modifier and Type | Method and Description |
|---|---|
Directory |
directory() |
int |
docFreq(Term t) |
protected void |
doClose() |
protected void |
doCommit() |
Document |
document(int n)
Returns the stored fields of the
nth
Document in this index. |
Document |
document(int n,
FieldSelector fieldSelector)
Return the
Document at the nth
position. |
protected void |
doDelete(int docNum) |
protected void |
doSetNorm(int doc,
java.lang.String field,
byte value) |
protected void |
doUndeleteAll() |
java.util.Collection |
getFieldNames(IndexReader.FieldOption fieldOption) |
InstantiatedIndex |
getIndex() |
TermFreqVector |
getTermFreqVector(int docNumber,
java.lang.String field) |
void |
getTermFreqVector(int docNumber,
java.lang.String field,
TermVectorMapper mapper) |
void |
getTermFreqVector(int docNumber,
TermVectorMapper mapper) |
TermFreqVector[] |
getTermFreqVectors(int docNumber) |
long |
getVersion()
An InstantiatedIndexReader is not a snapshot in time, it is completely in
sync with the latest commit to the store!
|
boolean |
hasDeletions() |
boolean |
isCurrent()
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) |
boolean |
isOptimized() |
int |
maxDoc() |
byte[] |
norms(java.lang.String field)
never ever touch these values.
|
void |
norms(java.lang.String field,
byte[] bytes,
int offset) |
int |
numDocs() |
TermDocs |
termDocs() |
TermPositions |
termPositions() |
TermEnum |
terms() |
TermEnum |
terms(Term t) |
acquireWriteLock, close, commit, decRef, deleteDocument, deleteDocuments, ensureOpen, flush, getCurrentVersion, getCurrentVersion, getCurrentVersion, getIndexCommit, getTermInfosIndexDivisor, hasNorms, 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, unlockpublic InstantiatedIndexReader(InstantiatedIndex index)
public boolean isOptimized()
isOptimized in class IndexReaderpublic long getVersion()
getVersion in class IndexReaderInstantiatedIndex.getVersion() in associated instantiated index.public Directory directory()
directory in class IndexReaderpublic boolean isCurrent()
throws java.io.IOException
false, in which case you must open a new IndexReader in
order to see the changes. See the description of the autoCommit flag
which controls when the IndexWriter actually commits changes to the
index.isCurrent in class IndexReaderCorruptIndexException - if the index is corruptjava.io.IOException - if there is a low-level IO errorjava.lang.UnsupportedOperationException - unless overridden in subclasspublic InstantiatedIndex getIndex()
public int numDocs()
numDocs in class IndexReaderpublic int maxDoc()
maxDoc in class IndexReaderpublic boolean isDeleted(int n)
isDeleted in class IndexReaderpublic boolean hasDeletions()
hasDeletions in class IndexReaderprotected void doDelete(int docNum)
throws java.io.IOException
doDelete in class IndexReaderjava.io.IOExceptionprotected void doUndeleteAll()
throws java.io.IOException
doUndeleteAll in class IndexReaderjava.io.IOExceptionprotected void doCommit()
throws java.io.IOException
doCommit in class IndexReaderjava.io.IOExceptionprotected void doClose()
throws java.io.IOException
doClose in class IndexReaderjava.io.IOExceptionpublic java.util.Collection getFieldNames(IndexReader.FieldOption fieldOption)
getFieldNames in class IndexReaderpublic Document document(int n, FieldSelector fieldSelector) throws CorruptIndexException, java.io.IOException
Document at the nth
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 canges of stored values,
but be carful! Adding a field with an name unknown to the index
or to a field with previously no stored values will make
getFieldNames(org.apache.lucene.index.IndexReader.FieldOption)
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!
document in class IndexReadern - document numberfieldSelector - ignoredDocument at the nth positionCorruptIndexException - if the index is corruptjava.io.IOException - if there is a low-level IO errorFieldable,
FieldSelector,
SetBasedFieldSelector,
LoadFirstFieldSelectorpublic Document document(int n) throws java.io.IOException
nth
Document in this index.
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 canges of stored values,
but be carful! Adding a field with an name unknown to the index
or to a field with previously no stored values will make
getFieldNames(org.apache.lucene.index.IndexReader.FieldOption)
out of sync, causing problems for instance when merging the
instantiated index to another index.
document in class IndexReaderCorruptIndexException - if the index is corruptjava.io.IOException - if there is a low-level IO errorpublic byte[] norms(java.lang.String field)
throws java.io.IOException
norms in class IndexReaderjava.io.IOExceptionpublic void norms(java.lang.String field,
byte[] bytes,
int offset)
throws java.io.IOException
norms in class IndexReaderjava.io.IOExceptionprotected void doSetNorm(int doc,
java.lang.String field,
byte value)
throws java.io.IOException
doSetNorm in class IndexReaderjava.io.IOExceptionpublic int docFreq(Term t) throws java.io.IOException
docFreq in class IndexReaderjava.io.IOExceptionpublic TermEnum terms() throws java.io.IOException
terms in class IndexReaderjava.io.IOExceptionpublic TermEnum terms(Term t) throws java.io.IOException
terms in class IndexReaderjava.io.IOExceptionpublic TermDocs termDocs() throws java.io.IOException
termDocs in class IndexReaderjava.io.IOExceptionpublic TermPositions termPositions() throws java.io.IOException
termPositions in class IndexReaderjava.io.IOExceptionpublic TermFreqVector[] getTermFreqVectors(int docNumber) throws java.io.IOException
getTermFreqVectors in class IndexReaderjava.io.IOExceptionpublic TermFreqVector getTermFreqVector(int docNumber, java.lang.String field) throws java.io.IOException
getTermFreqVector in class IndexReaderjava.io.IOExceptionpublic void getTermFreqVector(int docNumber,
java.lang.String field,
TermVectorMapper mapper)
throws java.io.IOException
getTermFreqVector in class IndexReaderjava.io.IOExceptionpublic void getTermFreqVector(int docNumber,
TermVectorMapper mapper)
throws java.io.IOException
getTermFreqVector in class IndexReaderjava.io.IOExceptionCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.