code: public boolean doesResourceExist(final String resourcePath) throws IOException {
          Response response = elasticSearchAdminClient.performRequest(HttpMethod.HEAD, resourcePath);
          return response.getStatusLine().getStatusCode() == HttpStatus.SC_OK;
      }
docs: Determines whether a resource exists in ES. This will call a GET method to a particular path and
  return true if status 200; false otherwise.
  
  @param resourcePath The path of the resource to get.
  @return True if it exists; false otherwise.
  @throws IOException If an error occurred during requests to ES.