Skip to content

Fix opensearch_api _bulk endpoint to return proper JSON response#6878

Open
divakarsingh wants to merge 1 commit into
opensearch-project:mainfrom
divakarsingh:fix/bulk-response-body
Open

Fix opensearch_api _bulk endpoint to return proper JSON response#6878
divakarsingh wants to merge 1 commit into
opensearch-project:mainfrom
divakarsingh:fix/bulk-response-body

Conversation

@divakarsingh
Copy link
Copy Markdown

Description
The _bulk endpoint returned an empty HTTP 200 with no body. Clients using RestHighLevelClient (Flink, Logstash, opensearch-py)
expect a JSON response with {took, errors, items[]} and fail with "Unable to parse response body".

This adds buildBulkResponse() which constructs a response matching the OpenSearch Bulk API format.

Issues Resolved
Resolves #6877

Check List

  • New functionality includes testing
  • Commits are signed with DCO (Signed-off-by)

The _bulk endpoint returned an empty HTTP 200 with no body. Clients using
RestHighLevelClient (Flink, Logstash, opensearch-py) expect a JSON response
with {took, errors, items[]} and fail with 'Unable to parse response body'.

This adds buildBulkResponse() which constructs a response matching the
OpenSearch Bulk API format, iterating through the parsed action/doc pairs
and producing one item per action.

Resolves opensearch-project#6877

Signed-off-by: Divakar Pratap Singh <divakar.p.singh@gmail.com>
@divakarsingh divakarsingh force-pushed the fix/bulk-response-body branch from 7236d5b to 91d5147 Compare May 21, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] opensearch_api source: _bulk endpoint returns empty HTTP 200 with no JSON body

1 participant