| java.lang.Object org.apache.lucene.index.IndexReader org.apache.lucene.index.ParallelReader
ParallelReader | public class ParallelReader extends IndexReader (Code) | | An IndexReader which reads multiple, parallel indexes. Each index added
must have the same number of documents, but typically each contains
different fields. Each document contains the union of the fields of all
documents with the same document number. When searching, matches for a
query term are from the first index added that has the field.
This is useful, e.g., with collections that have large fields which
change rarely and small fields that change more frequently. The smaller
fields may be re-indexed in a new index and both indexes may be searched
together.
Warning: It is up to you to make sure all indexes
are created and modified the same way. For example, if you add
documents to one index, you need to add the same documents in the
same order to the other indexes. Failure to do so will result in
undefined behavior.
|
Constructor Summary | |
public | ParallelReader() Construct a ParallelReader. | public | ParallelReader(boolean closeSubReaders) Construct a ParallelReader. |
Method Summary | |
public void | add(IndexReader reader) Add an IndexReader. | public void | add(IndexReader reader, boolean ignoreStoredFields) Add an IndexReader whose stored fields will not be returned. | protected synchronized void | doClose() | protected void | doCommit() | protected void | doDelete(int n) | protected void | doSetNorm(int n, String field, byte value) | protected void | doUndeleteAll() | public int | docFreq(Term term) | public Document | document(int n, FieldSelector fieldSelector) | public Collection | getFieldNames(IndexReader.FieldOption fieldNames) | IndexReader[] | getSubReaders() | public TermFreqVector | getTermFreqVector(int n, String field) | public void | getTermFreqVector(int docNumber, String field, TermVectorMapper mapper) | public void | getTermFreqVector(int docNumber, TermVectorMapper mapper) | public TermFreqVector[] | getTermFreqVectors(int n) | public long | getVersion() Not implemented. | public boolean | hasDeletions() | public boolean | hasNorms(String field) | public boolean | isCurrent() Checks recursively if all subreaders are up to date. | public boolean | isDeleted(int n) | public boolean | isOptimized() | public int | maxDoc() | public byte[] | norms(String field) | public void | norms(String field, byte[] result, int offset) | public int | numDocs() | public IndexReader | reopen() Tries to reopen the subreaders.
If one or more subreaders could be re-opened (i. | public TermDocs | termDocs(Term term) | public TermDocs | termDocs() | public TermPositions | termPositions(Term term) | public TermPositions | termPositions() | public TermEnum | terms() | public TermEnum | terms(Term term) |
incRefReaders | boolean incRefReaders(Code) | | |
ParallelReader | public ParallelReader() throws IOException(Code) | | Construct a ParallelReader.
Note that all subreaders are closed if this ParallelReader is closed.
|
ParallelReader | public ParallelReader(boolean closeSubReaders) throws IOException(Code) | | Construct a ParallelReader.
Parameters: closeSubReaders - indicates whether the subreaders should be closedwhen this ParallelReader is closed |
hasDeletions | public boolean hasDeletions()(Code) | | |
isDeleted | public boolean isDeleted(int n)(Code) | | |
isOptimized | public boolean isOptimized()(Code) | | Checks recursively if all subindexes are optimized
|
maxDoc | public int maxDoc()(Code) | | |
numDocs | public int numDocs()(Code) | | |
reopen | public IndexReader reopen() throws CorruptIndexException, IOException(Code) | | Tries to reopen the subreaders.
If one or more subreaders could be re-opened (i. e. subReader.reopen()
returned a new instance != subReader), then a new ParallelReader instance
is returned, otherwise this instance is returned.
A re-opened instance might share one or more subreaders with the old
instance. Index modification operations result in undefined behavior
when performed before the old instance is closed.
(see
IndexReader.reopen ).
If subreaders are shared, then the reference count of those
readers is increased to ensure that the subreaders remain open
until the last referring reader is closed.
throws: CorruptIndexException - if the index is corrupt throws: IOException - if there is a low-level IO error |
Fields inherited from org.apache.lucene.index.IndexReader | protected boolean hasChanges(Code)(Java Doc)
|
Methods inherited from org.apache.lucene.index.IndexReader | protected synchronized void acquireWriteLock() throws IOException(Code)(Java Doc) final public synchronized void close() throws IOException(Code)(Java Doc) final protected synchronized void commit() throws IOException(Code)(Java Doc) protected synchronized void decRef() throws IOException(Code)(Java Doc) final public synchronized void deleteDocument(int docNum) throws StaleReaderException, CorruptIndexException, LockObtainFailedException, IOException(Code)(Java Doc) final public int deleteDocuments(Term term) throws StaleReaderException, CorruptIndexException, LockObtainFailedException, IOException(Code)(Java Doc) public Directory directory()(Code)(Java Doc) abstract protected void doClose() throws IOException(Code)(Java Doc) abstract protected void doCommit() throws IOException(Code)(Java Doc) abstract protected void doDelete(int docNum) throws CorruptIndexException, IOException(Code)(Java Doc) abstract protected void doSetNorm(int doc, String field, byte value) throws CorruptIndexException, IOException(Code)(Java Doc) abstract protected void doUndeleteAll() throws CorruptIndexException, IOException(Code)(Java Doc) abstract public int docFreq(Term t) throws IOException(Code)(Java Doc) public Document document(int n) throws CorruptIndexException, IOException(Code)(Java Doc) abstract public Document document(int n, FieldSelector fieldSelector) throws CorruptIndexException, IOException(Code)(Java Doc) final protected void ensureOpen() throws AlreadyClosedException(Code)(Java Doc) final public synchronized void flush() throws IOException(Code)(Java Doc) public static long getCurrentVersion(String directory) throws CorruptIndexException, IOException(Code)(Java Doc) public static long getCurrentVersion(File directory) throws CorruptIndexException, IOException(Code)(Java Doc) public static long getCurrentVersion(Directory directory) throws CorruptIndexException, IOException(Code)(Java Doc) abstract public Collection getFieldNames(FieldOption fldOption)(Code)(Java Doc) synchronized int getRefCount()(Code)(Java Doc) abstract public TermFreqVector getTermFreqVector(int docNumber, String field) throws IOException(Code)(Java Doc) abstract public void getTermFreqVector(int docNumber, String field, TermVectorMapper mapper) throws IOException(Code)(Java Doc) abstract public void getTermFreqVector(int docNumber, TermVectorMapper mapper) throws IOException(Code)(Java Doc) abstract public TermFreqVector[] getTermFreqVectors(int docNumber) throws IOException(Code)(Java Doc) public int getTermInfosIndexDivisor()(Code)(Java Doc) public long getVersion()(Code)(Java Doc) abstract public boolean hasDeletions()(Code)(Java Doc) public boolean hasNorms(String field) throws IOException(Code)(Java Doc) protected synchronized void incRef()(Code)(Java Doc) public static boolean indexExists(String directory)(Code)(Java Doc) public static boolean indexExists(File directory)(Code)(Java Doc) public static boolean indexExists(Directory directory) throws IOException(Code)(Java Doc) public boolean isCurrent() throws CorruptIndexException, IOException(Code)(Java Doc) abstract public boolean isDeleted(int n)(Code)(Java Doc) public static boolean isLocked(Directory directory) throws IOException(Code)(Java Doc) public static boolean isLocked(String directory) throws IOException(Code)(Java Doc) public boolean isOptimized()(Code)(Java Doc) public static long lastModified(String directory) throws CorruptIndexException, IOException(Code)(Java Doc) public static long lastModified(File fileDirectory) throws CorruptIndexException, IOException(Code)(Java Doc) public static long lastModified(Directory directory2) throws CorruptIndexException, IOException(Code)(Java Doc) public static void main(String[] args)(Code)(Java Doc) abstract public int maxDoc()(Code)(Java Doc) abstract public byte[] norms(String field) throws IOException(Code)(Java Doc) abstract public void norms(String field, byte[] bytes, int offset) throws IOException(Code)(Java Doc) abstract public int numDocs()(Code)(Java Doc) public static IndexReader open(String path) throws CorruptIndexException, IOException(Code)(Java Doc) public static IndexReader open(File path) throws CorruptIndexException, IOException(Code)(Java Doc) public static IndexReader open(Directory directory) throws CorruptIndexException, IOException(Code)(Java Doc) public static IndexReader open(Directory directory, IndexDeletionPolicy deletionPolicy) throws CorruptIndexException, IOException(Code)(Java Doc) public synchronized IndexReader reopen() throws CorruptIndexException, IOException(Code)(Java Doc) final public synchronized void setNorm(int doc, String field, byte value) throws StaleReaderException, CorruptIndexException, LockObtainFailedException, IOException(Code)(Java Doc) public void setNorm(int doc, String field, float value) throws StaleReaderException, CorruptIndexException, LockObtainFailedException, IOException(Code)(Java Doc) public void setTermInfosIndexDivisor(int indexDivisor) throws IllegalStateException(Code)(Java Doc) public TermDocs termDocs(Term term) throws IOException(Code)(Java Doc) abstract public TermDocs termDocs() throws IOException(Code)(Java Doc) public TermPositions termPositions(Term term) throws IOException(Code)(Java Doc) abstract public TermPositions termPositions() throws IOException(Code)(Java Doc) abstract public TermEnum terms() throws IOException(Code)(Java Doc) abstract public TermEnum terms(Term t) throws IOException(Code)(Java Doc) final public synchronized void undeleteAll() throws StaleReaderException, CorruptIndexException, LockObtainFailedException, IOException(Code)(Java Doc) public static void unlock(Directory directory) throws IOException(Code)(Java Doc)
|
|
|