Apache Solr open-source search software
fix TestKnnGraph test failure if it gets SimpleText
Robert Muir96eb043131c3
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.java b/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.javaindex ba2496066ff..b8e34aebff9 100644--- a/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.java+++ b/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.java@@ -213,8 +213,10 @@ public class TestKnnGraph extends LuceneTestCase {public void testSearch() throws Exception {// We can't use dot product here since the vectors are laid out on a grid, not a sphere.searchStrategy = SearchStrategy.EUCLIDEAN_HNSW;+ IndexWriterConfig config = newIndexWriterConfig();+ config.setCodec(Codec.forName("Lucene90")); // test is not compatible with simpletexttry (Directory dir = newDirectory();- IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig())) {+ IndexWriter iw = new IndexWriter(dir, config)) {// Add a document for every cartesian point in an NxN square so we can// easily know which are the nearest neighbors to every point. Insert by iterating// using a prime number that is not a divisor of N*N so that we will hit each point once,