opensearch-project / opensearch-project/opensearch-java

[BUG] BukResponseItem not returning the source document back

Open
#1,322 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Java
Stars
165
Forks
250
Avg merge
1d 18h
Merged PRs (30d)
26

Description

What is the bug?

BukResponseItem not returning the source document back

How can one reproduce the bug?

BulkRequest.Builder().operations(ops)
.source(SourceConfigParam.Builder().fetch(true).build())
.refresh(Refresh.True).timeout(Time.Builder().time(“1h”).build())
.build()

client.bulk(bulkRequest)

bulkResponse.items().first().get() is null in the response. Ops have only one item here.

What is the expected behavior?

bulkResponse.items().first().get() should return the source document back

What is your host/environment?

OpenSearch Version: 2.16.0
Java Client: 2.10.1

Do you have any screenshots?
Do you have any additional context?

My requirement is to fetch the source document back in the bulk response for each of the bulk response item. This is to post process the dependencies based on the changed data and status.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the request using BulkRequest.Builder, SourceConfigParam.Builder, and bulkResponse.items().first().get() against OpenSearch 2.16.0 with Java Client 2.10.1. Trace the bulk response handling and verify that each response item returns its source document when fetch(true) is set; done means the reported source is available for post-processing.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.