Skip to content

How to get more information on failed bulk requests using IndexedObjectInformation? #1981

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

Closed
amitga opened this issue Oct 31, 2021 · 4 comments · Fixed by #1982
Closed

How to get more information on failed bulk requests using IndexedObjectInformation? #1981

amitga opened this issue Oct 31, 2021 · 4 comments · Fixed by #1982
Labels
type: documentation A documentation update

Comments

@amitga
Copy link

amitga commented Oct 31, 2021

Hi.
I have searched high and low, but could not find information on how to get information on failed bulk operations using elasticsearchOperations.bulkIndex().
All it returns is a list of IndexedObjectInformation which has some odd members, but nothing about the indexing errors.

Your help would be greatly appreciated.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 31, 2021
@sothawo
Copy link
Collaborator

sothawo commented Oct 31, 2021

When a bulk operation fails it throws a BulkFailureException. This exception has a method public Map<String, String> getFailedDocuments(). This maps from the id of the document to the failure message.

@sothawo sothawo added the status: waiting-for-feedback We need additional information before we can continue label Oct 31, 2021
@amitga
Copy link
Author

amitga commented Nov 1, 2021

Cool, thanks!
I must have missed that somehow.
Maybe an example in the Spring Docs would prevent future confusion for other developers too.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Nov 1, 2021
sothawo added a commit that referenced this issue Nov 1, 2021
Original Pull Request #1982 
Closes #1981
@sothawo sothawo added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Nov 1, 2021
@sothawo sothawo added this to the 4.3 GA (2021.1.0) milestone Nov 1, 2021
@sothawo
Copy link
Collaborator

sothawo commented Nov 1, 2021

I added the information to the JavaDoc of the relevant methods.

@amitga
Copy link
Author

amitga commented Nov 2, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants