Skip to content

Commit

Permalink
Making version of lucene k-nn engine match lucene current version (#691
Browse files Browse the repository at this point in the history
…) (#712)

* Making version of lucene k-nn engine match lucene current version

Signed-off-by: Martin Gaievski <[email protected]>
(cherry picked from commit 577205e)

Co-authored-by: Martin Gaievski <[email protected]>
  • Loading branch information
1 parent 084f94f commit dd7d0c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/opensearch/knn/index/util/Lucene.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class Lucene extends JVMLibrary {
).addSpaces(SpaceType.L2, SpaceType.COSINESIMIL).build()
);

final static Lucene INSTANCE = new Lucene(METHODS, Version.LUCENE_9_2_0.toString());
final static Lucene INSTANCE = new Lucene(METHODS, Version.LATEST.toString());

/**
* Constructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class KNNEngineTests extends KNNTestCase {
*/
public void testDelegateLibraryFunctions() {
assertEquals(Nmslib.INSTANCE.getVersion(), KNNEngine.NMSLIB.getVersion());
assertEquals(Faiss.INSTANCE.getVersion(), KNNEngine.FAISS.getVersion());
assertEquals(Lucene.INSTANCE.getVersion(), KNNEngine.LUCENE.getVersion());
}

/**
Expand Down
6 changes: 6 additions & 0 deletions src/test/java/org/opensearch/knn/index/util/LuceneTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

package org.opensearch.knn.index.util;

import org.apache.lucene.util.Version;
import org.opensearch.common.xcontent.XContentBuilder;
import org.opensearch.common.xcontent.XContentFactory;
import org.opensearch.knn.KNNTestCase;
Expand Down Expand Up @@ -108,4 +109,9 @@ public void testSetInitialized() {
luceneLibrary.setInitialized(true);
assertTrue(luceneLibrary.isInitialized());
}

public void testVersion() {
Lucene luceneInstance = Lucene.INSTANCE;
assertEquals(Version.LATEST.toString(), luceneInstance.getVersion());
}
}

0 comments on commit dd7d0c5

Please sign in to comment.