From 4735b4c12fef1723b41ed022ac30340aaea1d372 Mon Sep 17 00:00:00 2001 From: Adrien Grand Date: Sat, 14 Nov 2020 15:38:01 +0100 Subject: [PATCH] LUCENE-9378: Fix test failure. --- .../codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lucene/core/src/test/org/apache/lucene/codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java b/lucene/core/src/test/org/apache/lucene/codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java index 35c07bf2af7..b5851c44cc5 100644 --- a/lucene/core/src/test/org/apache/lucene/codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java +++ b/lucene/core/src/test/org/apache/lucene/codecs/lucene80/BaseLucene80DocValuesFormatTestCase.java @@ -31,6 +31,7 @@ import org.apache.lucene.analysis.MockAnalyzer; import org.apache.lucene.codecs.DocValuesFormat; import org.apache.lucene.codecs.PostingsFormat; import org.apache.lucene.codecs.asserting.AssertingCodec; +import org.apache.lucene.codecs.perfield.PerFieldDocValuesFormat; import org.apache.lucene.document.BinaryDocValuesField; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; @@ -278,7 +279,7 @@ public abstract class BaseLucene80DocValuesFormatTestCase extends BaseCompressin conf.setMergeScheduler(new SerialMergeScheduler()); // set to duel against a codec which has ordinals: final PostingsFormat pf = TestUtil.getPostingsFormatWithOrds(random()); - final DocValuesFormat dv = getCodec().docValuesFormat(); + final DocValuesFormat dv = ((PerFieldDocValuesFormat) getCodec().docValuesFormat()).getDocValuesFormatForField("random_field_name"); conf.setCodec(new AssertingCodec() { @Override public PostingsFormat getPostingsFormatForField(String field) {