diff --git a/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestCase.java b/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestCase.java index b5ef7f180..fb96040a2 100644 --- a/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestCase.java +++ b/src/test/java/org/opensearch/knn/index/codec/KNNCodecTestCase.java @@ -9,6 +9,7 @@ import com.google.common.collect.ImmutableSet; import org.apache.lucene.codecs.perfield.PerFieldKnnVectorsFormat; import org.apache.lucene.document.KnnVectorField; +import org.apache.lucene.index.NoMergePolicy; import org.apache.lucene.index.VectorSimilarityFunction; import org.apache.lucene.search.Query; import org.apache.lucene.search.TopDocs; @@ -121,6 +122,7 @@ public void testMultiFieldsKnnIndex(Codec codec) throws Exception { IndexWriterConfig iwc = newIndexWriterConfig(); iwc.setMergeScheduler(new SerialMergeScheduler()); iwc.setCodec(codec); + iwc.setMergePolicy(NoMergePolicy.INSTANCE); /** * Add doc with field "test_vector" @@ -223,6 +225,7 @@ public void testBuildFromModelTemplate(Codec codec) throws IOException, Executio IndexWriterConfig iwc = newIndexWriterConfig(); iwc.setMergeScheduler(new SerialMergeScheduler()); iwc.setCodec(codec); + iwc.setMergePolicy(NoMergePolicy.INSTANCE); FieldType fieldType = new FieldType(KNNVectorFieldMapper.Defaults.FIELD_TYPE); fieldType.putAttribute(KNNConstants.MODEL_ID, modelId); @@ -317,6 +320,7 @@ public void testKnnVectorIndex( IndexWriterConfig iwc = newIndexWriterConfig(); iwc.setMergeScheduler(new SerialMergeScheduler()); iwc.setCodec(codec); + iwc.setMergePolicy(NoMergePolicy.INSTANCE); /** * Add doc with field "test_vector_one"