You are using the transport client, this is deprecated, use the high level rest client instead as shown here.