Sorry for spamming my own thread, but these are possibly some other
ActionFuture exists =
IndicesExistsResponse actionGet = exists.actionGet();
boolean hasIndex = actionGet.exists();
com.sun.jersey.api.client.Client jerseyClient =
WebResource webResource = jerseyClient.resource("http://192.168.1.100/
ClientResponse head = webResource.head();
boolean indexExists = head.getStatus() == 200;
It all seems a bit hacky though. If checking for index existence is an
operation that has caveats, that should probably be outlined in the
documentation. Anyway, still looking forward to understanding what the
preferred way is, and what the possible caveats of each method are.
On Apr 17, 9:50 pm, Kosta kosta.kra...@gmail.com wrote:
I have been reading the group for ways in which to check the existence
of an index, and using the JAVA API, this seems to be the preferred
ClusterStateResponse response =
boolean hasIndex =
To say that this is fairly verbose would be an understatement,
especially when you consider it with the suggested method in the
official reference guide:http://www.elasticsearch.org/guide/reference/api/admin-indices-indice...
This seems a lot cleaner and simpler, so I am wondering, are there any
pitfalls involved with using this way over the JAVA API one? Thanks.