title: How to use BulkProcessor in elasticsearch batch processing
body: <p>I need to use bulkprocessor of Elasticsearch to insert some bulk datas into elastic search.
  This is what i got from elastic.co</p>
  
  <pre><code>import org.elasticsearch.action.bulk.BulkProcessor;
  
  BulkProcessor bulkProcessor = BulkProcessor.builder(
      client,  
      new BulkProcessor.Listener() {
          @Override
          public void beforeBulk(long executionId,
                                 BulkRequest request) { } 
  
          @Override
          public void afterBulk(long executionId,
                                BulkRequest request,
                                BulkResponse response) { } 
  
          @Override
          public void afterBulk(long executionId,
                                BulkRequest request,
                                Throwable failure) { } 
      })
      .setBulkActions(10000) 
      .setBulkSize(new ByteSizeValue(1, ByteSizeUnit.GB)) 
      .setFlushInterval(TimeValue.timeValueSeconds(5)) 
      .setConcurrentRequests(1) 
      .build();
  
  bulkProcessor.add(new IndexRequest("twitter", "tweet", "1").source("helloworld"));
  bulkProcessor.add(new DeleteRequest("twitter", "tweet", "2"));
  </code></pre>
  
  <p>whether i need to call the BulkProcessor.builder for all batch insert process? Is this the right way to use the bulkprocessor?</p>