diff --git a/CHANGELOG.md b/CHANGELOG.md index 347c4b3c7..5021a36d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,4 +24,5 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Infrastructure ### Documentation ### Maintenance +- Update bwc tests for neural_query_enricher neural_sparse search ([#652](https://github.com/opensearch-project/neural-search/pull/652)) ### Refactoring diff --git a/qa/restart-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/NeuralQueryEnricherProcessorIT.java b/qa/restart-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/NeuralQueryEnricherProcessorIT.java index d27b9d0f3..876b2b0d7 100644 --- a/qa/restart-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/NeuralQueryEnricherProcessorIT.java +++ b/qa/restart-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/NeuralQueryEnricherProcessorIT.java @@ -54,6 +54,10 @@ public void testNeuralQueryEnricherProcessor_NeuralSparseSearch_E2EFlow() throws getIndexNameForTest(), Settings.builder().put("index.search.default_pipeline", SPARSE_SEARCH_PIPELINE_NAME) ); + assertEquals( + search(getIndexNameForTest(), sparseEncodingQueryBuilderWithoutModelId, 1).get("hits"), + search(getIndexNameForTest(), sparseEncodingQueryBuilderWithModelId, 1).get("hits") + ); } else { String modelId = null; try { diff --git a/qa/rolling-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/NeuralQueryEnricherProcessorIT.java b/qa/rolling-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/NeuralQueryEnricherProcessorIT.java index 7a98b7322..281c78821 100644 --- a/qa/rolling-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/NeuralQueryEnricherProcessorIT.java +++ b/qa/rolling-upgrade/src/test/java/org/opensearch/neuralsearch/bwc/NeuralQueryEnricherProcessorIT.java @@ -57,11 +57,20 @@ public void testNeuralQueryEnricherProcessor_NeuralSparseSearch_E2EFlow() throws getIndexNameForTest(), Settings.builder().put("index.search.default_pipeline", SPARSE_SEARCH_PIPELINE_NAME) ); + assertEquals( + search(getIndexNameForTest(), sparseEncodingQueryBuilderWithoutModelId, 1).get("hits"), + search(getIndexNameForTest(), sparseEncodingQueryBuilderWithModelId, 1).get("hits") + ); break; case MIXED: sparseModelId = TestUtils.getModelId(getIngestionPipeline(SPARSE_INGEST_PIPELINE_NAME), SPARSE_ENCODING_PROCESSOR); loadModel(sparseModelId); sparseEncodingQueryBuilderWithModelId.modelId(sparseModelId); + + assertEquals( + search(getIndexNameForTest(), sparseEncodingQueryBuilderWithoutModelId, 1).get("hits"), + search(getIndexNameForTest(), sparseEncodingQueryBuilderWithModelId, 1).get("hits") + ); break; case UPGRADED: try { @@ -117,11 +126,6 @@ public void testNeuralQueryEnricherProcessor_NeuralSearch_E2EFlow() throws Excep loadModel(denseModelId); neuralQueryBuilderWithModelId.modelId(denseModelId); - createSearchRequestProcessor(denseModelId, DENSE_SEARCH_PIPELINE_NAME); - updateIndexSettings( - getIndexNameForTest(), - Settings.builder().put("index.search.default_pipeline", DENSE_SEARCH_PIPELINE_NAME) - ); assertEquals( search(getIndexNameForTest(), neuralQueryBuilderWithoutModelId, 1).get("hits"), search(getIndexNameForTest(), neuralQueryBuilderWithModelId, 1).get("hits")