Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Sokolov committed Dec 6, 2024
1 parent 7d56ee3 commit eafa803
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<Document> docs = new ArrayList<>();

Expand Down

0 comments on commit eafa803

Please sign in to comment.