ElasticSearch index exists not working / reliable

前端 未结 5 1527
攒了一身酷
攒了一身酷 2021-02-19 09:41

I am writing a simple Java wrapper around ElasticSearch\'s admin client. To test it I have a main method that first checks if an index exists (IndicesExistsRequest), if so delet

5条回答
  •  有刺的猬
    2021-02-19 10:30

    You can also execute a synchronous request like this:

    boolean exists = client.admin().indices()
        .prepareExists(INDEX_NAME)
        .execute().actionGet().isExists();
    

提交回复
热议问题