title: How to insert document into ElasticSearch using RestHighLevelClient in Java Spring Boot
body: <p>I am developing a Spring Boot program that use RestHighLevelClient to insert document into ElasticSearch. Now I have built the configuration for the client, however, I am not sure how to insert/index. The documentation on ElasticSearch seems confusing to me..</p>
  
  <p>Here is the piece of code I tried so far:</p>
  
  <pre><code>@KafkaListener(topics = "${kafka.topic}",groupId = "test")
  public void receive(String message) {
  
      LOGGER.info(message);
      insertData(message);
      latch.countDown();
  }
  
  private void insertData(String message){
      IndexRequest request = new IndexRequest(
              "fx-rate",
              "_doc",
              "1");
      request.source(message, XContentType.JSON);
  }
  </code></pre>