Skip to content

Commit

Permalink
opensearchutil: add missing bulk indexer response item fields
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
igungor committed Feb 9, 2022
1 parent 79d499d commit 633fb1e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -44,4 +44,4 @@ This project is licensed under the [Apache v2.0 License](LICENSE.txt).

## Copyright

Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details.
Copyright OpenSearch Contributors. See [NOTICE](NOTICE.txt) for details.
18 changes: 15 additions & 3 deletions opensearchutil/bulk_indexer.go
Expand Up @@ -150,9 +150,21 @@ type BulkIndexerResponseItem struct {
Type string `json:"type"`
Reason string `json:"reason"`
Cause struct {
Type string `json:"type"`
Reason string `json:"reason"`
} `json:"caused_by"`
Type string `json:"type"`
Reason string `json:"reason"`
ScriptStack *[]string `json:"script_stack,omitempty"`
Script *string `json:"script,omitempty"`
Lang *string `json:"lang,omitempty"`
Position *struct {
Offset int `json:"offset"`
Start int `json:"start"`
End int `json:"end"`
} `json:"position,omitempty"`
Cause *struct {
Type string `json:"type"`
Reason string `json:"reason"`
} `json:"caused_by"`
} `json:"caused_by,omitempty"`
} `json:"error,omitempty"`
}

Expand Down

0 comments on commit 633fb1e

Please sign in to comment.