# BukResponseItem not returning the source document back

**URL:** <https://forum.opensearch.org/t/bukresponseitem-not-returning-the-source-document-back/22503>\
**Category:** OpenSearch Client Libraries\
**Tags:** opensearch-java\
**Created:** [November 19, 2024, 7:45am UTC](https://forum.opensearch.org/t/bukresponseitem-not-returning-the-source-document-back/22503 "2024-11-19T07:45:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pabrahamraju](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pabrahamraju](https://forum.opensearch.org/u/pabrahamraju)\
**Post date:** [November 19, 2024, 7:45am UTC](https://forum.opensearch.org/t/bukresponseitem-not-returning-the-source-document-back/22503/1 "2024-11-19T07:45:20Z")

</div>

**Versions** (relevant - OpenSearch/Dashboard/Server OS/Browser):  
OpenSearch Version: 2.16.0  
Java Client: 2.10.1

**Describe the issue** :  
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.

Can someone please share any examples to achieve this?

I tried below and the response still have the get as null.

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.

---

<div class="post-metadata">

**Author:** ![reta](https://avatars.discourse-cdn.com/v4/letter/r/cdc98d/32.png) [@reta](https://forum.opensearch.org/u/reta)\
**Post date:** [November 21, 2024, 6:15pm UTC](https://forum.opensearch.org/t/bukresponseitem-not-returning-the-source-document-back/22503/2 "2024-11-21T18:15:16Z")

</div>

It looks like a bug, could you please create an issue here [1]? Thank you

[1] [Issues · opensearch-project/opensearch-java · GitHub](https://github.com/opensearch-project/opensearch-java/issues)

---

<div class="post-metadata">

**Author:** ![pabrahamraju](https://avatars.discourse-cdn.com/v4/letter/p/f07891/32.png) [@pabrahamraju](https://forum.opensearch.org/u/pabrahamraju)\
**Post date:** [November 22, 2024, 4:40am UTC](https://forum.opensearch.org/t/bukresponseitem-not-returning-the-source-document-back/22503/3 "2024-11-22T04:40:34Z")

</div>

Thank you @reta . Created a bug: [[BUG] BukResponseItem not returning the source document back · Issue #1322 · opensearch-project/opensearch-java · GitHub](https://github.com/opensearch-project/opensearch-java/issues/1322)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/mauve_hedgehog/original/2X/3/33547ea01a5b12dcca2958411d3edd97ae2ea8c1.png) [@system](https://forum.opensearch.org/u/system)\
**Post date:** [January 21, 2025, 4:41am UTC](https://forum.opensearch.org/t/bukresponseitem-not-returning-the-source-document-back/22503/4 "2025-01-21T04:41:13Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
