try {
int size = way.getWayNodes().size();
ESShape shape = getShape(iterator, size);
ESWay esWay = ESWay.Builder.buildFromEntity(way, shape);
bulkRequest.add(client.prepareIndex(indexName, esWay.getEntityType().getIndiceName(), esWay.getIdString())
.setSource(esWay.toJson()));
} catch (Exception e) {
LOG.warning(String.format("Unable to add Entity %s to bulk request, cause: %s",
way.getId(), e.getMessage()));
}
}