-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for SplitResponseProcessor (#526)
* Add tests for SplitResponseProcessor Signed-off-by: Daniel Widdis <[email protected]> * Remove CHANGELOG entry for test addition Signed-off-by: Daniel Widdis <[email protected]> * Update docker image to include these changes Signed-off-by: Daniel Widdis <[email protected]> * Input should be a string not a single element array of string Signed-off-by: Daniel Widdis <[email protected]> --------- Signed-off-by: Daniel Widdis <[email protected]>
- Loading branch information
Showing
4 changed files
with
83 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
tests/default/_core/search/pipeline/request_processor/filter_query.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
79 changes: 79 additions & 0 deletions
79
tests/default/_core/search/pipeline/response_processor/split_and_sort.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
$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 |