code: public boolean isExistingIndex(String index) throws IOException {
          logger.debug("is existing index [{}]", index);
          GetIndexRequest gir = new GetIndexRequest();
          gir.indices(index);
          return client.indices().exists(gir, RequestOptions.DEFAULT);
      }
docs: Check if an index exists
  @param index index name
  @return true if the index exists, false otherwise
  @throws IOException In case of error