code: public void indexDocument(String indexName, String mappingName, String id, XContentBuilder document)
              throws Exception {
          client.prepareIndex(indexName, mappingName, id).setSource(document).get();
      }
docs: Indexes a document.
  
  @param indexName
  @param mappingName
  @param id          unique identifier of the document
  @param document
  @throws Exception