fix test bug

This commit is contained in:
Mike McCandless 2016-09-23 06:13:26 -04:00
parent 53dd74bd87
commit 24ec3bd085
1 changed files with 5 additions and 0 deletions

View File

@ -171,6 +171,11 @@ public abstract class BasePointsFormatTestCase extends BaseIndexFileFormatTestCa
PointValues values = ctx.reader().getPointValues();
NumericDocValues idValues = ctx.reader().getNumericDocValues("id");
if (idValues == null) {
// this is (surprisingly) OK, because if the random IWC flushes all 10 docs before the 11th doc is added, and force merge runs, it
// will drop the 100% deleted segments, and the "id" field never exists in the final single doc segment
continue;
}
int[] docIDToID = new int[ctx.reader().maxDoc()];
int docID;
while ((docID = idValues.nextDoc()) != NO_MORE_DOCS) {