java - Elaticsearch Transport Client: Why did a delete fail? -
i using transport client elasticsearch version 2.3. can't figure out how tell if delete failed because of error condition or because document not exist.
deleteresponse deleteresponse = transportclient.preparedelete("indexname", "type", idtodelete).execute().get(); boolean isfound = deleteresponse.isfound();
i can tell when isfound true document deleted. if not deleted, how tell why? have failed because:
- the document didn't exist
- the elasticsearch server down
- the index or type not exist.
- some sort of network communication problem.
i need handle these scenarios distinctly.
Comments
Post a Comment