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
opensearchutil: add missing bulk indexer response item fields #90
Conversation
@igungor can you amend your first commit instead of empty second commit to keep this PR simple.
|
opensearchutil/bulk_indexer.go
Outdated
Type string `json:"type"` | ||
Reason string `json:"reason"` | ||
ScriptStack []string `json:"script_stack"` | ||
Script string `json:"script"` | ||
Lang string `json:"lang"` | ||
Position struct { | ||
Offset int `json:"offset"` | ||
Start int `json:"start"` | ||
End int `json:"end"` | ||
} `json:"position"` | ||
Cause struct { | ||
Type string `json:"type"` | ||
Reason string `json:"reason"` | ||
} `json:"caused_by"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all this fields are non-optional if error exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the case I shared, yes they're non-optional. I'm not sure about other errors cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are not sure, we should make it optional too so that it will not break. Can you make those extra variables as pointer and add omitempty
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
2a0c0b0
to
2e66c22
Compare
Done. |
PTAL |
Looks good. Can you merge it into one commit with sign off or amend for last commit? |
If a bulk request contains any script error, Opensearch server points what is wrong with the request. This information is valuable to those debugging what is wrong with the scripted request. Signed-off-by: İbrahim Güngör <igungor@gmail.com>
841093f
to
633fb1e
Compare
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks
Description
If a bulk request contains any script error, Opensearch server points to
what is wrong with the request. This information is valuable to those
debug what is going on under the hood.
This PR adds missing bulk indexer response item fields.
Reproducer script
Opensearch response
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.