indexing - Apparent Race condition when deleting and recreating a elasticsearch index via the Java API -
i getting error - index exists when creating index deleted. below simple test created replicate behaviour:
client elasticsearchclient = elasticsearchlocalservice.getclient(); if (elasticsearchclient.admin().indices().exists(new indicesexistsrequest(indexname)).get().isexists()) elasticsearchclient.admin().indices().delete(new deleteindexrequest(indexname)).get(); elasticsearchclient.admin().indices().exists(new indicesexistsrequest(indexname)).get().isexists();//returns false elasticsearchclient.admin().indices().create(new createindexrequest(indexname)).get();
even though second call check if index exists returns false still error, i've tried refresh index think affects data. expected .get on delete block until finished.
thanks !