code: public static boolean isTemplateExist(RestClient client, String template) throws IOException {
  		Response response = client.performRequest(new Request("HEAD", "/_template/" + template));
  		return response.getStatusLine().getStatusCode() == 200;
  	}
docs: Check if a template exists
  @param client Elasticsearch client
  @param template template name
  @return true if the template exists
  @throws IOException if something goes wrong