@Override public void handleRequest(final RestRequest request, final RestChannel channel) {
BulkRequest bulkRequest = Requests.bulkRequest();
String replicationType = request.param("replication");
if (replicationType != null) {
bulkRequest.replicationType(ReplicationType.fromString(replicationType));
}
String consistencyLevel = request.param("consistency");
if (consistencyLevel != null) {
bulkRequest.consistencyLevel(WriteConsistencyLevel.fromString(consistencyLevel));
}