# BulkRequest with Java API Client missing document part

**URL:** <https://discuss.elastic.co/t/bulkrequest-with-java-api-client-missing-document-part/333077>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [May 10, 2023, 11:00am UTC](https://discuss.elastic.co/t/bulkrequest-with-java-api-client-missing-document-part/333077 "2023-05-10T11:00:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DavJane](https://avatars.discourse-cdn.com/v4/letter/d/9dc877/32.png) [@DavJane](https://discuss.elastic.co/u/DavJane)\
**Post date:** [May 10, 2023, 11:00am UTC](https://discuss.elastic.co/t/bulkrequest-with-java-api-client-missing-document-part/333077/1 "2023-05-10T11:00:47Z")

</div>

Hi all,

I am migrating from Elasticsearch high rest client 6.x to Java API client and have encountered an issue with the BulkRequest.

I am creating a json string and sending that in as part of the document part of the request as follows:

```auto
       Reader reader = new StringReader(my-json-string);
	JsonData jd = JsonData.from(jsonProvider.createParser(reader), jsonpMapper);
	br.operations(op -> op.index(idx -> idx.index(indexName).id(String.valueOf(e.getId())).document(jd)));	
	reader.close();
				
	Time.Builder tbr = new Time.Builder();
        tbr.time("5m");
        br.timeout(tbr.build());
        BulkRequest request = br.build();
        BulkResponse bulkResponse = esClient.bulk(request);

```

When I look at my request, it is shown as follows and is missing the document part which I have supplied via the JSON string

```auto
BulkRequest: POST /_bulk?timeout=5m [{"index":{"_id":"1","_index":"my-daily-export"}}]

```

Can someone please point me to what am doing wrong here?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 7, 2023, 11:00am UTC](https://discuss.elastic.co/t/bulkrequest-with-java-api-client-missing-document-part/333077/2 "2023-06-07T11:00:52Z")

</div>

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