|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.index.IndexReader org.apache.lucene.store.instantiated.InstantiatedIndexReader
public class InstantiatedIndexReader
An 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.apache.lucene.index.IndexReader |
---|
org.apache.lucene.index.IndexReader.FieldOption, org.apache.lucene.index.IndexReader.ReaderFinishedListener |
Field Summary |
---|
Fields inherited from class org.apache.lucene.index.IndexReader |
---|
hasChanges, readerFinishedListeners |
Constructor Summary | |
---|---|
InstantiatedIndexReader(InstantiatedIndex index)
|
Method Summary | |
---|---|
org.apache.lucene.store.Directory |
directory()
|
int |
docFreq(org.apache.lucene.index.Term t)
|
protected void |
doClose()
|
protected void |
doCommit(Map<String,String> commitUserData)
|
org.apache.lucene.document.Document |
document(int n)
Returns the stored fields of the n th
Document in this index. |
org.apache.lucene.document.Document |
document(int n,
org.apache.lucene.document.FieldSelector fieldSelector)
Return the Document at the n th
position. |
protected void |
doDelete(int docNum)
|
protected void |
doSetNorm(int doc,
String field,
byte value)
|
protected void |
doUndeleteAll()
|
Collection<String> |
getFieldNames(org.apache.lucene.index.IndexReader.FieldOption fieldOption)
|
InstantiatedIndex |
getIndex()
|
org.apache.lucene.index.TermFreqVector |
getTermFreqVector(int docNumber,
String field)
|
void |
getTermFreqVector(int docNumber,
String field,
org.apache.lucene.index.TermVectorMapper mapper)
|
void |
getTermFreqVector(int docNumber,
org.apache.lucene.index.TermVectorMapper mapper)
|
org.apache.lucene.index.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(String field)
never ever touch these values. |
void |
norms(String field,
byte[] bytes,
int offset)
|
int |
numDocs()
|
org.apache.lucene.index.TermDocs |
termDocs()
|
org.apache.lucene.index.TermDocs |
termDocs(org.apache.lucene.index.Term term)
|
org.apache.lucene.index.TermPositions |
termPositions()
|
org.apache.lucene.index.TermEnum |
terms()
|
org.apache.lucene.index.TermEnum |
terms(org.apache.lucene.index.Term t)
|
Methods inherited from class org.apache.lucene.index.IndexReader |
---|
acquireWriteLock, addReaderFinishedListener, clone, clone, close, commit, commit, decRef, deleteDocument, deleteDocuments, ensureOpen, flush, flush, getCommitUserData, getCommitUserData, getCoreCacheKey, getCurrentVersion, getDeletesCacheKey, getIndexCommit, getRefCount, getSequentialSubReaders, getTermInfosIndexDivisor, getUniqueTermCount, hasNorms, incRef, indexExists, lastModified, listCommits, main, notifyReaderFinishedListeners, numDeletedDocs, open, open, open, open, open, open, open, open, readerFinished, removeReaderFinishedListener, reopen, reopen, reopen, reopen, setNorm, setNorm, termPositions, toString, undeleteAll |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InstantiatedIndexReader(InstantiatedIndex index)
Method Detail |
---|
public boolean isOptimized()
isOptimized
in class org.apache.lucene.index.IndexReader
public long getVersion()
getVersion
in class org.apache.lucene.index.IndexReader
InstantiatedIndex.getVersion()
in associated instantiated index.public org.apache.lucene.store.Directory directory()
directory
in class org.apache.lucene.index.IndexReader
public boolean isCurrent() throws 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 org.apache.lucene.index.IndexReader
org.apache.lucene.index.CorruptIndexException
- if the index is corrupt
IOException
- if there is a low-level IO error
UnsupportedOperationException
- unless overridden in subclasspublic InstantiatedIndex getIndex()
public int numDocs()
numDocs
in class org.apache.lucene.index.IndexReader
public int maxDoc()
maxDoc
in class org.apache.lucene.index.IndexReader
public boolean hasDeletions()
hasDeletions
in class org.apache.lucene.index.IndexReader
public boolean isDeleted(int n)
isDeleted
in class org.apache.lucene.index.IndexReader
protected void doDelete(int docNum) throws IOException
doDelete
in class org.apache.lucene.index.IndexReader
IOException
protected void doUndeleteAll() throws IOException
doUndeleteAll
in class org.apache.lucene.index.IndexReader
IOException
protected void doCommit(Map<String,String> commitUserData) throws IOException
doCommit
in class org.apache.lucene.index.IndexReader
IOException
protected void doClose() throws IOException
doClose
in class org.apache.lucene.index.IndexReader
IOException
public Collection<String> getFieldNames(org.apache.lucene.index.IndexReader.FieldOption fieldOption)
getFieldNames
in class org.apache.lucene.index.IndexReader
public org.apache.lucene.document.Document document(int n, org.apache.lucene.document.FieldSelector fieldSelector) throws org.apache.lucene.index.CorruptIndexException, IOException
Document
at the n
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
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 org.apache.lucene.index.IndexReader
n
- document numberfieldSelector
- ignored
Document
at the nth position
org.apache.lucene.index.CorruptIndexException
- if the index is corrupt
IOException
- if there is a low-level IO errorFieldable
,
FieldSelector
,
SetBasedFieldSelector
,
LoadFirstFieldSelector
public org.apache.lucene.document.Document document(int n) throws IOException
n
th
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 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
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 org.apache.lucene.index.IndexReader
org.apache.lucene.index.CorruptIndexException
- if the index is corrupt
IOException
- if there is a low-level IO errorpublic byte[] norms(String field) throws IOException
norms
in class org.apache.lucene.index.IndexReader
IOException
public void norms(String field, byte[] bytes, int offset) throws IOException
norms
in class org.apache.lucene.index.IndexReader
IOException
protected void doSetNorm(int doc, String field, byte value) throws IOException
doSetNorm
in class org.apache.lucene.index.IndexReader
IOException
public int docFreq(org.apache.lucene.index.Term t) throws IOException
docFreq
in class org.apache.lucene.index.IndexReader
IOException
public org.apache.lucene.index.TermEnum terms() throws IOException
terms
in class org.apache.lucene.index.IndexReader
IOException
public org.apache.lucene.index.TermEnum terms(org.apache.lucene.index.Term t) throws IOException
terms
in class org.apache.lucene.index.IndexReader
IOException
public org.apache.lucene.index.TermDocs termDocs() throws IOException
termDocs
in class org.apache.lucene.index.IndexReader
IOException
public org.apache.lucene.index.TermDocs termDocs(org.apache.lucene.index.Term term) throws IOException
termDocs
in class org.apache.lucene.index.IndexReader
IOException
public org.apache.lucene.index.TermPositions termPositions() throws IOException
termPositions
in class org.apache.lucene.index.IndexReader
IOException
public org.apache.lucene.index.TermFreqVector[] getTermFreqVectors(int docNumber) throws IOException
getTermFreqVectors
in class org.apache.lucene.index.IndexReader
IOException
public org.apache.lucene.index.TermFreqVector getTermFreqVector(int docNumber, String field) throws IOException
getTermFreqVector
in class org.apache.lucene.index.IndexReader
IOException
public void getTermFreqVector(int docNumber, String field, org.apache.lucene.index.TermVectorMapper mapper) throws IOException
getTermFreqVector
in class org.apache.lucene.index.IndexReader
IOException
public void getTermFreqVector(int docNumber, org.apache.lucene.index.TermVectorMapper mapper) throws IOException
getTermFreqVector
in class org.apache.lucene.index.IndexReader
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |