mirror of https://github.com/apache/lucene.git
LUCENE-2559: add SegmentReader.reopen
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@980436 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1a153246d1
commit
317b939949
|
@ -193,6 +193,9 @@ New features
|
|||
SegmentInfosReader to allow customization of SegmentInfos data.
|
||||
(Andrzej Bialecki)
|
||||
|
||||
* LUCENE-2559: Added SegmentReader.reopen methods (John Wang via Mike
|
||||
McCandless)
|
||||
|
||||
Optimizations
|
||||
|
||||
* LUCENE-2410: ~20% speedup on exact (slop=0) PhraseQuery matching.
|
||||
|
|
|
@ -611,6 +611,18 @@ public class SegmentReader extends IndexReader implements Cloneable {
|
|||
return reopenSegment(si, true, openReadOnly);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized IndexReader reopen()
|
||||
throws CorruptIndexException, IOException {
|
||||
return reopenSegment(si, false, readOnly);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized IndexReader reopen(boolean openReadOnly)
|
||||
throws CorruptIndexException, IOException {
|
||||
return reopenSegment(si, false, openReadOnly);
|
||||
}
|
||||
|
||||
synchronized SegmentReader reopenSegment(SegmentInfo si, boolean doClone, boolean openReadOnly) throws CorruptIndexException, IOException {
|
||||
boolean deletionsUpToDate = (this.si.hasDeletions() == si.hasDeletions())
|
||||
&& (!si.hasDeletions() || this.si.getDelFileName().equals(si.getDelFileName()));
|
||||
|
|
Loading…
Reference in New Issue