Transform BulkRequest from HLRC to Elastic 8.1.0

Hi, I need to transform below code to elastic 8.1.0

private BulkRequest createBulkRequest(List<ElasticSearchMessage> elasticSearchMessages, String indexName) {
        BulkRequest bulkRequest = new BulkRequest(indexName);
        for (ElasticSearchMessage elasticSearchMessage : elasticSearchMessages) {
            final IndexRequest indexRequest = buildIndex(elasticSearchMessage);
        return bulkRequest;

Since there are no enough docs for Java, it need some support.

I have created IndexRequest but adding into BulkRequest is problem. Bulk request isto create index in elastic

BulkRequest bulkRequest = new BulkRequest.Builder()

Take a look at this sample test in the repo (documentation is coming, just might take some more time): elasticsearch-java/ at main · elastic/elasticsearch-java · GitHub

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.