code: public static boolean isIndexExist(RestClient client, String index) throws Exception {
  		Response response = client.performRequest(new Request("HEAD", "/" + index));
  		return response.getStatusLine().getStatusCode() == 200;
  	}
docs: Check if an index already exists
  @param client Elasticsearch client
  @param index Index name
  @return true if index already exists
  @throws Exception if the elasticsearch API call is failing