LUCENE-9378: Fix test failure.

This commit is contained in:
Adrien Grand 2020-11-14 15:38:01 +01:00
parent 8503efdcff
commit 4735b4c12f
1 changed files with 2 additions and 1 deletions

View File

@ -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) {