You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by to...@apache.org on 2020/01/12 06:11:45 UTC

[lucene-solr] 10/10: Use 'Lucene90' Codec for TestKnnGraph

This is an automated email from the ASF dual-hosted git repository.

tomoko pushed a commit to branch jira/lucene-9004-aknn-2
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit f7c2ae249ebcf9da12e66ed87704e41fd9768faa
Author: Tomoko Uchida <to...@apache.org>
AuthorDate: Sun Jan 12 14:59:51 2020 +0900

    Use 'Lucene90' Codec for TestKnnGraph
---
 .../core/src/test/org/apache/lucene/index/TestKnnGraph.java   | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.java b/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.java
index fe84c22..9579ead 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestKnnGraph.java
@@ -54,7 +54,7 @@ public class TestKnnGraph extends LuceneTestCase {
    */
   public void testBasic() throws Exception {
     try (Directory dir = newDirectory();
-         IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null))) {
+         IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null).setCodec(Codec.forName("Lucene90")))) {
       int numDoc = atLeast(10);
       int dimension = atLeast(3);
       float[][] values = new float[numDoc][];
@@ -73,7 +73,7 @@ public class TestKnnGraph extends LuceneTestCase {
 
   public void testSingleDocument() throws Exception {
     try (Directory dir = newDirectory();
-         IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null))) {
+         IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null).setCodec(Codec.forName("Lucene90")))) {
       float[][] values = new float[][]{new float[]{0, 1, 2}};
       add(iw, 0, values[0]);
       assertConsistentGraph(iw, values);
@@ -84,8 +84,7 @@ public class TestKnnGraph extends LuceneTestCase {
 
   public void testSingleDocRecall() throws  Exception {
     try (Directory dir = newDirectory();
-        IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null)
-            .setCodec(Codec.forName("Lucene90")))) {
+        IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null).setCodec(Codec.forName("Lucene90")))) {
       float[][] values = new float[][]{new float[]{0, 1, 2}};
       add(iw, 0, values[0]);
       assertConsistentGraph(iw, values);
@@ -102,7 +101,7 @@ public class TestKnnGraph extends LuceneTestCase {
    */
   public void testMerge() throws Exception {
     try (Directory dir = newDirectory();
-         IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null))) {
+         IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null).setCodec(Codec.forName("Lucene90")))) {
       int numDoc = atLeast(100);
       int dimension = atLeast(10);
       float[][] values = new float[numDoc][];
@@ -134,7 +133,7 @@ public class TestKnnGraph extends LuceneTestCase {
    */
   public void testSearch() throws Exception {
     try (Directory dir = newDirectory();
-         IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null))) {
+         IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(null).setCodec(Codec.forName("Lucene90")))) {
       // 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,