Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for retrieving fields in bulk updates #12114

Merged
merged 1 commit into from Jul 8, 2015
Merged

Add support for retrieving fields in bulk updates #12114

merged 1 commit into from Jul 8, 2015

Conversation

jasontedor
Copy link
Member

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

@jasontedor
Copy link
Member Author

Note that this pull request includes a REST test that fails in current master (reflecting that master does not currently support retrieving fields in bulk updates using any of the three forms) but passes with this pull request.

@@ -329,6 +331,8 @@ public BulkRequest add(BytesReference data, @Nullable String defaultIndex, @Null
versionType = VersionType.fromString(parser.text());
} else if ("_retry_on_conflict".equals(currentFieldName) || "_retryOnConflict".equals(currentFieldName)) {
retryOnConflict = parser.intValue();
} else if ("fields".equals(currentFieldName)) {
fields = Strings.splitStringByCommaToArray(parser.text());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we parse an actual list instead of a comma-delimited string list? I know the update request uses splitStringByCommaToArray but I think it is different since it gets the value from a query_string parameter while here you can provide actual json?

@jpountz
Copy link
Contributor

jpountz commented Jul 8, 2015

I left one question about how we should parse this fields parameter.

@jasontedor
Copy link
Member Author

@jpountz I agree as this would be consistent with how we handle fields in the request body in other parts of the API. I pushed a change that reflects this.

I also pushed a change that updates the bulk API documentation.

@jpountz
Copy link
Contributor

jpountz commented Jul 8, 2015

LGTM

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
jasontedor added a commit that referenced this pull request Jul 8, 2015
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
@jasontedor jasontedor merged commit cbcc553 into elastic:master Jul 8, 2015
@kevinkluge kevinkluge removed the review label Jul 8, 2015
@jasontedor jasontedor deleted the feature/11527 branch July 8, 2015 16:25
@lcawl lcawl added :Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. and removed :Bulk labels Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/CRUD A catch all label for issues around indexing, updating and getting a doc by id. Not search. >enhancement v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants