code: public boolean indexExists(String indexName) {
          return this.client.admin().indices().prepareExists(indexName).execute().actionGet().isExists();
      }
docs: Check if an index exists in ES
  
  @param indexName
  @return true if the index exists or false if the index does not exits.