Skip to content

Commit

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

Signed-off-by: zhichao-aws <zhichaog@amazon.com>

* changelog

Signed-off-by: zhichao-aws <zhichaog@amazon.com>

* nit

Signed-off-by: zhichao-aws <zhichaog@amazon.com>

---------

Signed-off-by: zhichao-aws <zhichaog@amazon.com>
(cherry picked from commit 4b71e49)

Co-authored-by: zhichao-aws <zhichaog@amazon.com>
  • Loading branch information
opensearch-trigger-bot[bot] and zhichao-aws authored Apr 10, 2024
1 parent d52c640 commit d8f126f
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 @@ -21,4 +21,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 d8f126f

Please sign in to comment.