This repository shows a few examples of how to use the Elasticsearch High Level REST client. It is using Testcontainers for Elasticsearch, so you need to have Docker up and running.
You can run the tests via ./gradlew clean verify
, but I suppose just reading
the source in an IDE is more interesting.