commit changes after doRandomForceMerge, or otherwise they're lost

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1607778 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shai Erera 2014-07-04 03:23:05 +00:00
parent 006bee46c8
commit f878737c44
1 changed files with 2 additions and 0 deletions

View File

@ -364,6 +364,8 @@ public class RandomIndexWriter implements Closeable {
// forceMerge since presumably they might open a reader on the dir.
if (getReaderCalled == false && r.nextInt(8) == 2) {
doRandomForceMerge();
// index may have changed, must commit the changes, or otherwise they are discarded by the call to close()
w.commit();
}
w.close();
}