Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12114 from jasontedor/feature/11527
Add support for retrieving fields in bulk updates This commit adds support to retrieve fields when using the bulk update API. This functionality was previously available for the update API but not for the bulk update API. Closes #11527
- Loading branch information
Showing
7 changed files
with
85 additions
and
6 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
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
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
49 changes: 49 additions & 0 deletions
49
rest-api-spec/src/main/resources/rest-api-spec/test/bulk/40_fields.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,49 @@ | ||
--- | ||
"Fields": | ||
- do: | ||
index: | ||
refresh: true | ||
index: test_index | ||
type: test_type | ||
id: test_id_1 | ||
body: { "foo": "bar" } | ||
|
||
- do: | ||
index: | ||
refresh: true | ||
index: test_index | ||
type: test_type | ||
id: test_id_2 | ||
body: { "foo": "qux" } | ||
|
||
- do: | ||
index: | ||
refresh: true | ||
index: test_index | ||
type: test_type | ||
id: test_id_3 | ||
body: { "foo": "corge" } | ||
|
||
|
||
- do: | ||
bulk: | ||
refresh: true | ||
body: | | ||
{ "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "fields": ["_source"] } } | ||
{ "doc": { "foo": "baz" } } | ||
{ "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2" } } | ||
{ "fields": ["_source"], "doc": { "foo": "quux" } } | ||
- match: { items.0.update.get._source.foo: baz } | ||
- match: { items.1.update.get._source.foo: quux } | ||
|
||
- do: | ||
bulk: | ||
index: test_index | ||
type: test_type | ||
fields: _source | ||
body: | | ||
{ "update": { "_id": "test_id_3" } } | ||
{ "doc": { "foo": "garply" } } | ||
- match: { items.0.update.get._source.foo: garply } |