Basic Java-ElasticSearch full-lifecycle example: Creates data, queries it, displays results to console, then deletes & exits

I'm struggling to find a Java-ElasticSearch tutorial. I'm looking for a single standalone class that demonstrates the full lifecycle, including creating reasonably-realistic data, queries it a few times, displays those results to the console, and then deletes the data and exits.

Any advice would be very appreciated. I have successfully gone through the official getting-started webinar (which does not discuss Java).


Best way is probably to look at the test classes. The code coverage is
excellent, so you will find examples for almost every API in Elasticsearch.


Thank you Ivan.