Skip to content

Commit

Permalink
Update neural_query_enricher bwc tests (#652)
Browse files Browse the repository at this point in the history
* update neural_query_enricher bwc

Signed-off-by: zhichao-aws <[email protected]>

* changelog

Signed-off-by: zhichao-aws <[email protected]>

* nit

Signed-off-by: zhichao-aws <[email protected]>

---------

Signed-off-by: zhichao-aws <[email protected]>
  • Loading branch information
zhichao-aws authored Apr 10, 2024
1 parent cb83e20 commit 4b71e49
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 4b71e49

Please sign in to comment.