Java code to connect elasticsearch

HI folks,
How can I connect ElasticSearch using Java class.
we have requirment suchs as we need java code to send request and get response from ElasticSearch .

The questions are:

  • what did you do?
  • what are the logs or the errors?
  • did you read the guide?