randomly commit in RIW.getReader even when pulling an NRT reader

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1152288 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2011-07-29 16:05:06 +00:00
parent 75e72c1fd9
commit cc735b6e93
1 changed files with 3 additions and 0 deletions

View File

@ -354,6 +354,9 @@ public class RandomIndexWriter implements Closeable {
if (LuceneTestCase.VERBOSE) {
System.out.println("RIW.getReader: use NRT reader");
}
if (r.nextInt(5) == 1) {
w.commit();
}
return w.getReader(applyDeletions);
} else {
if (LuceneTestCase.VERBOSE) {