# BulkProcessor issue -- docs appear to be sent by client, but index doesn't change

**URL:** https://discuss.elastic.co/t/bulkprocessor-issue-docs-appear-to-be-sent-by-client-but-index-doesnt-change/20728
**Category:** Elasticsearch
**Created:** [November 13, 2014, 4:52pm UTC](https://discuss.elastic.co/t/bulkprocessor-issue-docs-appear-to-be-sent-by-client-but-index-doesnt-change/20728 "2014-11-13T16:52:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![raidex\_sym](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@raidex\_sym](https://discuss.elastic.co/u/raidex_sym)
#### Post date: [November 13, 2014, 4:52pm UTC](https://discuss.elastic.co/t/bulkprocessor-issue-docs-appear-to-be-sent-by-client-but-index-doesnt-change/20728/1 "2014-11-13T16:52:29Z")

</div>

Can anyone kindly point out why I could be seeing bulk indexing apparently  
succeeding on a client but my document count being always zero? I am using  
the BulkProcessor API as shown below. If I insert documents individually  
via curl, the index is properly updated. I also see all my bulk insert  
threads on the server busy and the bulk queue hovering around 150, yet the  
filesystem is virtually idle, I see no docs being inserted and no growth on  
the index data files. Tried flushing and refreshing manually to no avail.  
The code below spins happily reporting no errors. Any help is greatly  
appreciated.

```
    class CustomBulkListener extends BulkProcessor.Listener {
      override def beforeBulk (executionId:Long, request: BulkRequest) 

```

= {  
logger.info("Before bulk: {} actions", request.numberOfActions)  
}

```
      override def afterBulk (executionId:Long, request: BulkRequest, 

```

response: BulkResponse) = {  
logger.info("After bulk: {} actions", request.numberOfActions)  
}

```
      override def afterBulk (executionId:Long, request: BulkRequest, 

```

failure: Throwable) = {  
logger.warn("Error executing bulk", failure)  
}  
}

```
   val bulkProcessor: BulkProcessor = BulkProcessor.
     builder(myTransportClient, new CustomBulkListener).
     setBulkActions(1000).
     setBulkSize(new ByteSizeValue(1, ByteSizeUnit.GB)).
  setFlushInterval(TimeValue.timeValueSeconds(5)).
  setConcurrentRequests(30).build

  var bulkRequest = targetEsClient.prepareBulk

  val source = """{"some":"test data"}"""
  val totalTuples = 10*1000*1000

  logger.info("Starting insert loop for $totalTuples docs")
  for (i <- 1 to totalTuples) {
    val indexRequest = new IndexRequest(Parms.targetIndex, 

```

Parms.docType).source(source)  
bulkProcessor.add(indexRequest)  
if (i % 1000 == 0) logger.info(s"At $i docs")  
}

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/c71ef1f5-294f-4693-b288-0263325e1c37%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/c71ef1f5-294f-4693-b288-0263325e1c37%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [July 6, 2017, 12:50am UTC](https://discuss.elastic.co/t/bulkprocessor-issue-docs-appear-to-be-sent-by-client-but-index-doesnt-change/20728/2 "2017-07-06T00:50:10Z")

</div>


