title: Elasticsearch bulk insert using rest client
body: <p>To improve performance, I want to send documents to Elasticsearch in bulk instead sending one by one. I've read about elastic bulk API at <a href="https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-docs-bulk.html" rel="noreferrer">https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-docs-bulk.html</a></p>
  
  <p>However, I am using Elasticsearch rest-client (<a href="https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/index.html" rel="noreferrer">https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/index.html</a>) and couldn't find any example or documentation about how to make a bulk insert. All I could find was about bulk requests through transport client. </p>
  
  <p>I guess I have to prepare request body as described here (<a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html" rel="noreferrer">https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html</a>) and pass it to restclient's performRequest method? Is there another way, for instance, a builder mechanism in the ES java rest-client library,  to make bulk insert using rest?</p>