# Data loss- injection using transport client

**URL:** https://discuss.elastic.co/t/data-loss-injection-using-transport-client/177209
**Category:** Elasticsearch
**Created:** [April 17, 2019, 7:11am UTC](https://discuss.elastic.co/t/data-loss-injection-using-transport-client/177209 "2019-04-17T07:11:55Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![hen\_kling](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hen_kling/32/44299_2.png) [@hen\_kling](https://discuss.elastic.co/u/hen_kling)
#### Post date: [April 17, 2019, 7:11am UTC](https://discuss.elastic.co/t/data-loss-injection-using-transport-client/177209/1 "2019-04-17T07:11:55Z")

</div>

Hi,  
I sent bluk to elasticsearch via Nifi using PutElasticsearch5 processor.

In the Nifi processor code:  
When sent to elastic sesrch using transport client, i got an array of responses for each in the bulk.  
I checked if there was a problem, using elastic client libraries:  
Org.elasticsearch.action.BulkItemResponse  
Org.elssticsearch.action.BulkResponse  
For every bulk we got a successful response ( BulkResponce class) for each doc in bulk.

Then, i encountered a problem:  
When accessed to the index in ES, i noticed that there was some missing docs (about 0.7%)  
I checked the logs in the ES environment and didn't see anything that indicates loss of data in the index.  
The elastic env was stable during the insert, and also the Nifi environment.

Any idea what could cause this situation?  
Thank you 🙂

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [April 17, 2019, 7:52am UTC](https://discuss.elastic.co/t/data-loss-injection-using-transport-client/177209/2 "2019-04-17T07:52:45Z")

</div>

> [@hen\_kling](#):
>
> For every bulk we got a successful response ( BulkResponce class) for each doc in bulk.

This doesn't quite make sense, and the ambiguity is important to resolve since it is germane to your question. You get one `BulkResponse` for each bulk request, and it contains many `BulkItemResponse` objects. Each `BulkItemResponse` might be successful or failed, which you can check with `BulkResponse#hasFailures()`. What exactly do you mean here?

Also, did you remember to [refresh](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-refresh.html) the index before your searches?

---

<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: [May 15, 2019, 8:02am UTC](https://discuss.elastic.co/t/data-loss-injection-using-transport-client/177209/3 "2019-05-15T08:02:00Z")

</div>

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