Bulk index w/ new java-client

Hi, I'm looking for an example of how to do a bulk insert w/ the new java-client (8.1).

Previously (w/ ES 7) I used the high level rest client and a BulkProcessor .

Thanks

The BulkProcessor has not been implemented yet in the new client but it will be soon.

Here's some code:

List<BulkOperation> operations = new ArrayList<>();
operations.add(new BulkOperation(IndexOperation.of(b -> b.index("person").id(person.idAsString()).document(person))));
esClient.bulk(br -> br.index("person").operations(operations));

The documentation will be improved in the future.

Here is also a useful class:

Thank you for your time. I'll give it a try soon.
So I see it's on the agenda - do you have an estimate timeline?
Thanks again.

I don't. @swallez would probably know if there is a target for this.

We don't have an exact target but it's very high on the feature priority list. Important to note also that it will be backported to 7.17.

only post ive found on this, thanks to the guys @elastic for the comments, Im also trying to implement the new java api over the old one with it being deprecated and the docs are non existent. to anyone else i would recommend using the old libs for the time being.

I think this is the issue regarding the bulk processor topic - for anyone else stumbling upon this thread in the future

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