Skip to content

Commit

Permalink
Disable KNN format randomization in some KNN block join tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Sokolov committed Dec 9, 2024
1 parent 6b0112c commit 4f8035c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import org.apache.lucene.store.Directory;
import org.apache.lucene.tests.index.RandomIndexWriter;
import org.apache.lucene.tests.util.LuceneTestCase;
import org.apache.lucene.tests.util.TestUtil;

abstract class ParentBlockJoinKnnVectorQueryTestCase extends LuceneTestCase {

Expand Down Expand Up @@ -185,7 +186,10 @@ public void testScoringWithMultipleChildren() throws IOException {
try (Directory d = newDirectory()) {
try (IndexWriter w =
new IndexWriter(
d, newIndexWriterConfig().setMergePolicy(newMergePolicy(random(), false)))) {
d,
newIndexWriterConfig()
.setCodec(TestUtil.getDefaultCodec())
.setMergePolicy(newMergePolicy(random(), false)))) {
List<Document> toAdd = new ArrayList<>();
for (int j = 1; j <= 5; j++) {
Document doc = new Document();
Expand Down Expand Up @@ -240,7 +244,8 @@ public void testSkewedIndex() throws IOException {
* randomly fail to find one).
*/
try (Directory d = newDirectory()) {
try (IndexWriter w = new IndexWriter(d, new IndexWriterConfig())) {
try (IndexWriter w =
new IndexWriter(d, new IndexWriterConfig().setCodec(TestUtil.getDefaultCodec()))) {
int r = 0;
for (int i = 0; i < 5; i++) {
for (int j = 0; j < 5; j++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import org.apache.lucene.search.Query;
import org.apache.lucene.search.TermQuery;
import org.apache.lucene.store.Directory;
import org.apache.lucene.tests.util.TestUtil;

public class TestParentBlockJoinFloatKnnVectorQuery extends ParentBlockJoinKnnVectorQueryTestCase {

Expand Down Expand Up @@ -76,7 +77,10 @@ public void testScoreCosine() throws IOException {
try (Directory d = newDirectory()) {
try (IndexWriter w =
new IndexWriter(
d, new IndexWriterConfig().setMergePolicy(newMergePolicy(random(), false)))) {
d,
new IndexWriterConfig()
.setCodec(TestUtil.getDefaultCodec())
.setMergePolicy(newMergePolicy(random(), false)))) {
for (int j = 1; j <= 5; j++) {
List<Document> toAdd = new ArrayList<>();
Document doc = new Document();
Expand Down

0 comments on commit 4f8035c

Please sign in to comment.