mirror of https://github.com/apache/lucene.git
Fixed a bug where adding an optimized index to an empty index failed.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@149614 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
1c31f33cce
commit
b91b113e86
|
@ -206,7 +206,8 @@ public final class IndexWriter {
|
||||||
flushRamSegments();
|
flushRamSegments();
|
||||||
while (segmentInfos.size() > 1 ||
|
while (segmentInfos.size() > 1 ||
|
||||||
(segmentInfos.size() == 1 &&
|
(segmentInfos.size() == 1 &&
|
||||||
SegmentReader.hasDeletions(segmentInfos.info(0)))){
|
(SegmentReader.hasDeletions(segmentInfos.info(0)) ||
|
||||||
|
segmentInfos.info(0).dir != directory))) {
|
||||||
int minSegment = segmentInfos.size() - mergeFactor;
|
int minSegment = segmentInfos.size() - mergeFactor;
|
||||||
mergeSegments(minSegment < 0 ? 0 : minSegment);
|
mergeSegments(minSegment < 0 ? 0 : minSegment);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue