}
// only submit the bulk request if there are index/delete actions
// it is possible not to have any actions when parsing xml due to the
// commit and optimize messages that will not generate documents
if (bulkRequest.numberOfActions() > 0) {
client.bulk(bulkRequest, new ActionListener<BulkResponse>() {
// successful bulk request
public void onResponse(BulkResponse response) {
logger.info("Bulk request completed");