diff --git a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java index 6e333c0cbd70..5ecca4746de7 100644 --- a/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java +++ b/lucene/join/src/test/org/apache/lucene/search/join/TestBlockJoin.java @@ -27,6 +27,7 @@ import java.util.TreeMap; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.apache.lucene.codecs.KnnVectorsFormat; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.document.Field.Store; @@ -56,6 +57,7 @@ import org.apache.lucene.search.similarities.SimilarityBase; import org.apache.lucene.store.Directory; import org.apache.lucene.tests.analysis.MockAnalyzer; +import org.apache.lucene.tests.codecs.asserting.AssertingCodec; import org.apache.lucene.tests.index.RandomIndexWriter; import org.apache.lucene.tests.search.CheckHits; import org.apache.lucene.tests.search.QueryUtils; @@ -252,7 +254,17 @@ public void testSimpleKnn() throws Exception { final Directory dir = newDirectory(); final RandomIndexWriter w = new RandomIndexWriter( - random(), dir, newIndexWriterConfig().setMergePolicy(newMergePolicy(random(), false))); + random(), + dir, + newIndexWriterConfig() + .setCodec( + new AssertingCodec() { + @Override + public KnnVectorsFormat getKnnVectorsFormatForField(String field) { + return TestUtil.getDefaultKnnVectorsFormat(); + } + }) + .setMergePolicy(newMergePolicy(random(), false))); final List docs = new ArrayList<>();