String json = new Gson().toJson(metadata);
BulkRequestBuilder bulkRequest = client.prepareBulk();
bulkRequest.add(client.prepareIndex(index, "metadata", metadata.name).setSource(json));
BulkResponse bulkResponse = bulkRequest.execute().actionGet();
if(bulkResponse.hasFailures()) {
Crawler.logger.error("Elastic Search Failure: " + bulkResponse.buildFailureMessage());
}
} else {
unhandled(message);
}