forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ignore_missing parameter has no effect in rename ingest processor (…
…opensearch-project#9725) * Fix ignore_missing parameter has no effect when using template snippet in rename ingest processor Signed-off-by: Gao Binlong <[email protected]> * Small change Co-authored-by: Andriy Redko <[email protected]> Signed-off-by: gaobinlong <[email protected]> --------- Signed-off-by: Gao Binlong <[email protected]> Signed-off-by: gaobinlong <[email protected]> Co-authored-by: Andriy Redko <[email protected]>
- Loading branch information
1 parent
5e23147
commit 26355f5
Showing
4 changed files
with
86 additions
and
1 deletion.
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
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
66 changes: 66 additions & 0 deletions
66
...gest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/280_rename_processor.yml
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,66 @@ | ||
--- | ||
teardown: | ||
- do: | ||
ingest.delete_pipeline: | ||
id: "my_pipeline" | ||
ignore: 404 | ||
|
||
--- | ||
"Test rename processor with non-existing field and without ignore_missing": | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
body: > | ||
{ | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"rename" : { | ||
"field" : "{{field_foo}}", | ||
"target_field" : "bar" | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
catch: '/field path cannot be null nor empty/' | ||
index: | ||
index: test | ||
id: 1 | ||
pipeline: "my_pipeline" | ||
body: { message: "foo bar baz" } | ||
|
||
--- | ||
"Test rename processor with non-existing field and ignore_missing": | ||
- do: | ||
ingest.put_pipeline: | ||
id: "my_pipeline" | ||
body: > | ||
{ | ||
"description": "_description", | ||
"processors": [ | ||
{ | ||
"rename" : { | ||
"field" : "{{field_foo}}", | ||
"target_field" : "bar", | ||
"ignore_missing" : true | ||
} | ||
} | ||
] | ||
} | ||
- match: { acknowledged: true } | ||
|
||
- do: | ||
index: | ||
index: test | ||
id: 1 | ||
pipeline: "my_pipeline" | ||
body: { message: "foo bar baz" } | ||
|
||
- do: | ||
get: | ||
index: test | ||
id: 1 | ||
- match: { _source.message: "foo bar baz" } |