public boolean doesResourceExist ( final String resourcePath ) throws IOException { Response response = elasticSearchAdminClient . performRequest ( HttpMethod . HEAD , resourcePath ) ; return response . getStatusLine ( ) . getStatusCode ( ) == HttpStatus . SC_OK ; }
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 .