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

BulkAll Return Response with document _id's #3487

Closed
andystroz opened this issue Nov 9, 2018 · 2 comments
Closed

BulkAll Return Response with document _id's #3487

andystroz opened this issue Nov 9, 2018 · 2 comments

Comments

@andystroz
Copy link

NEST/Elasticsearch.Net version: 6.3.1

Elasticsearch version: 6.3

Describe the feature:

I am using the BulkAll interface to index a group of documents. I would like Elastic to Create the _id field for these documents so I do not specify it in my request. I would like to know the _id of the documents indexed, like the response of the index API or the standard bulk API. Could the response from Elastic be included in the BulkAllResponse?

I am thinking that all that needs be done is modify that class to include a response. Then include the successful response from Elastic here. When onNext is called in the subscriber the response for items included in that bulk update will be shown.

I could be completely off base with a solution / should I just write my own version of BulkAll with the functionality that I desire?

@russcam
Copy link
Contributor

russcam commented Jan 15, 2019

I think this would be a great addition to BulkAllResponse!

I am thinking that all that needs be done is modify that class to include a response. Then include the successful response from Elastic here. When onNext is called in the subscriber the response for items included in that bulk update will be shown.

A cursory glance, that looks like that would be needed. The values would come from the documentsWithResponse that are valid (.IsValid is true)

var documentsWithResponse = response.Items.Zip(buffer, Tuple.Create).ToList();

Is this something you would be interested in contributing?

russcam added a commit that referenced this issue Mar 13, 2019
This commit exposes the bulk response items on the BulkAllResponse.

Closes #3487
russcam added a commit that referenced this issue Mar 15, 2019
This commit exposes the bulk response items on the BulkAllResponse.

Closes #3487
@russcam
Copy link
Contributor

russcam commented Mar 19, 2019

#3598 has been merged and will be in the next release (6.6.0), so am closing this.

@russcam russcam closed this as completed Mar 19, 2019
russcam added a commit that referenced this issue Mar 20, 2019
This commit exposes the bulk response items on the BulkAllResponse.

Closes #3487
russcam added a commit that referenced this issue Mar 21, 2019
This commit exposes the bulk response items on the BulkAllResponse.

Closes #3487
russcam added a commit that referenced this issue Apr 2, 2019
This commit exposes the bulk response items on the BulkAllResponse.

Closes #3487

(cherry picked from commit 41eba8c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants