Now, I use
SearchGuard to secure my elasticsearch cluster.
And in the search-guard official website, I found the Transport Clients to create A client. But, due to the Elasticsearch official website's declare:
We plan on deprecating the
TransportClientin Elasticsearch 7.0 and removing it completely in 8.0. Instead, you should be using the Java High Level REST Client, which executes HTTP requests rather than serialized Java requests.
So I prefer to use Class
RestHighLevelClient to create the elasticsearch client!
But in this way, how could I write the code? Could someone provide the demo?