How to use Java High Level Rest Client with Spring Boot to talk to AWS Elasticsearch

Recently, for one of my projects, I needed to use Elasticsearch running on AWS Elasticsearch Service domain. When I created the cluster in AWS, I found out that theAWS Elasticsearch domain does not support Transport Client.

Why do I care about Transport Client?

There are two ways to communicate to a remote Elasticsearch cluster:

  1. RESTful API with JSON over HTTP

Java High Level REST Client to the rescue!

The great news is that Elasticsearch has developed a library called Java High Level REST Client. So if you are excited about how to use this library then read on.

  • Update a profile
  • Find a profile by the Id
  • Find all the profiles
  • Search all profiles matching a particular technology
  • Delete the profile by the id

Step-by-Step Guide to Use JHLRC

First thing we need is the Elasticsearch cluster in AWS. We will use the free tier which is free up to 750 hours per month and up to 10GB memory.

AWS Certified Solutions Architect | Snr. Software Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store