diff --git a/CHANGELOG.md b/CHANGELOG.md index c5a91329..70503f81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,7 +71,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added API spec for security plugin ([#271](https://github.com/opensearch-project/opensearch-api-specification/pull/271)) - Added `/_plugins/_security/api/certificates/` ([#439](https://github.com/opensearch-project/opensearch-api-specification/pull/439)) - Added `/_plugins/_ml/models/{model_id}/_deploy`, `_undeploy` and `knn_vector` type in `passage_embedding` ([#504](https://github.com/opensearch-project/opensearch-api-specification/pull/504)) -- Added `PersonalizeSearchRanking`, `RetrievalAugmentedGeneration`, `Rerank`, `Collapse`, `TruncateHits` and `SplitResponseProcessor` ([#505](https://github.com/opensearch-project/opensearch-api-specification/pull/505)) +- Added `PersonalizeSearchRanking`, `RetrievalAugmentedGeneration`, `Rerank`, `Collapse`, `TruncateHits`, `SortResponseProcessor` and `SplitResponseProcessor` ([#505](https://github.com/opensearch-project/opensearch-api-specification/pull/505)) - Added `/_plugins/_security/api/certificates/` to API spec ([#439](https://github.com/opensearch-project/opensearch-api-specification/pull/439)) - Added support for annotating and testing the API spec against multiple OpenSearch distributions ([#483](https://github.com/opensearch-project/opensearch-api-specification/pull/483)) - Added `read_time`, `write_time`, `queue_size` and `io_time_in_millis` to `IoStatDevice` ([#483](https://github.com/opensearch-project/opensearch-api-specification/pull/483)) @@ -79,6 +79,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `cancelled_task_percentage` and `current_cancellation_eligible_tasks_count` to `ShardSearchBackpressureTaskCancellationStats` ([#483](https://github.com/opensearch-project/opensearch-api-specification/pull/483)) - Added detailed test coverage report ([#513](https://github.com/opensearch-project/opensearch-api-specification/pull/513)) - Added 404 responses to `/_alias/{name}` and `/{index}/_alias/{name}` ([#519](https://github.com/opensearch-project/opensearch-api-specification/pull/519)) +- Added tests for `SplitResponseProcessor` ([#526](https://github.com/opensearch-project/opensearch-api-specification/pull/526)) ### Changed diff --git a/tests/default/_core/search/pipeline/request_processor/filter_query.yaml b/tests/default/_core/search/pipeline/request_processor/filter_query.yaml index e2d2cfb7..458eeb74 100644 --- a/tests/default/_core/search/pipeline/request_processor/filter_query.yaml +++ b/tests/default/_core/search/pipeline/request_processor/filter_query.yaml @@ -1,7 +1,7 @@ $schema: ../../../../../../json_schemas/test_story.schema.yaml description: |- - Test the creation of a search pipeline with a response processor. + Test the creation of a search pipeline with a filter_query request processor. version: '>= 2.8' prologues: - path: /_bulk diff --git a/tests/default/_core/search/pipeline/response_processor/split_and_sort.yaml b/tests/default/_core/search/pipeline/response_processor/split_and_sort.yaml new file mode 100644 index 00000000..e35e5f02 --- /dev/null +++ b/tests/default/_core/search/pipeline/response_processor/split_and_sort.yaml @@ -0,0 +1,81 @@ +$schema: ../../../../../../json_schemas/test_story.schema.yaml + +description: |- + Test the creation of a search pipeline with split and sort response processors. +version: '>= 2.17' +prologues: + - path: /numbers/_doc/1 + method: POST + parameters: + refresh: true + request: + payload: + number_string: + - 'zero,one,two,three' + status: [201] +epilogues: + - path: /_search/pipeline/numbers_pipeline + method: DELETE + status: [200, 404] + - path: /numbers + method: DELETE + status: [200, 404] +chapters: + - synopsis: Create search pipeline. + path: /_search/pipeline/{id} + method: PUT + parameters: + id: numbers_pipeline + request: + payload: + response_processors: + - split: + field: number_string + separator: ',' + target_field: number_strings + - sort: + field: number_strings + order: asc + target_field: sorted_number_strings + response: + status: 200 + payload: + acknowledged: true + - synopsis: Query created pipeline. + path: /_search/pipeline/{id} + method: GET + parameters: + id: numbers_pipeline + response: + status: 200 + - synopsis: Search. + warnings: + multiple-paths-detected: false + path: /{index}/_search + method: GET + parameters: + index: numbers + search_pipeline: numbers_pipeline + response: + status: 200 + payload: + hits: + total: + value: 1 + hits: + - _index: numbers + _source: + number_string: + - 'zero,one,two,three' + number_strings: + # eslint-disable yml/sort-sequence-values + - zero + - one + - two + - three + # eslint-enable yml/sort-sequence-values + sorted_number_strings: + - one + - three + - two + - zero \ No newline at end of file