I Have situation where i want to delete index from cluster.before i
need to check the availability of index in elastic server.if it
available then go for delete an index.please tell me how to get the
index exist in cluster using elastic java library.
You can try to IndicesExistsRequest and IndicesExistsResponse to verify
that.
You can build the request using IndicesAdminClient.
I had ever used it and it worked for me.
I Have situation where i want to delete index from cluster.before i need
to
check the availability of index in elastic server.if it available then go
for delete
an index.please tell me how to get the index exist in cluster using
elastic java
library.
I Have situation where i want to delete index from cluster.before i
need to check the availability of index in elastic server.if it
available then go for delete an index.please tell me how to get the
index exist in cluster using elastic java library.
I Have situation where i want to delete index from cluster.before i
need to check the availability of index in elastic server.if it
available then go for delete an index.please tell me how to get the
index exist in cluster using elastic java library.
try {
node.client().admin().indices()
.delete(new DeleteIndexRequest("myindexname")).actionGet();
} catch (IndexMissingException e) {
// Index does not exist... Fine
}
As you can see, I catch the IndexMissingException which grand grand grand parent is a RuntimeException.
I Have situation where i want to delete index from cluster.before i
need to check the availability of index in elastic server.if it
available then go for delete an index.please tell me how to get the
index exist in cluster using elastic java library.
You might get it wrapped in a RemoteException as well, if it ended up coming
from another node. The remove exception thingy is very handy when it comes
to debugging (has a trace of all the nodes that the failure came from), but,
it does not work amazingly well with java catch clauses... .
On Fri, Aug 26, 2011 at 7:21 PM, David Pilato david@pilato.fr wrote:
I'm sorry I have to disagree.
Here is what I wrote to force delete an index.
try {
node.client().admin().indices()
.delete(new
DeleteIndexRequest("myindexname")).actionGet();
} catch (IndexMissingException e) {
// Index does not exist... Fine
}
As you can see, I catch the IndexMissingException which grand grand grand
parent is a RuntimeException.
I Have situation where i want to delete index from cluster.before i
need to check the availability of index in elastic server.if it
available then go for delete an index.please tell me how to get the
index exist in cluster using elastic java library.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.