Skip to content

Apache Lucene open-source search software

don't add missing docs for the comparison unless the codec supports it (or the test will get complicated)

Robert Muir815ee4e2e6ad
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java b/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java
index 0e21308bda4..c36b049cffd 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestMultiDocValues.java
@@ -121,7 +121,7 @@ public class TestMultiDocValues extends LuceneTestCase {
int numDocs = atLeast(500);
for (int i = 0; i < numDocs; i++) {
ref.copyChars(_TestUtil.randomUnicodeString(random()));
- if (random().nextInt(7) == 0) {
+ if (defaultCodecSupportsDocsWithField() && random().nextInt(7) == 0) {
iw.addDocument(new Document());
}
iw.addDocument(doc);