Documentation for UpdateOperation

Is there any documentation for using UpdateOperation with the new Java API Client. I can't seem to find any. Some examples would be helpful. Thanks.

Hi @toddcarv

Maybe this example can help you.

Using builder style:

UpdateOperation<Movie, Movie> updateOperation = new UpdateOperation.Builder<Movie, Movie>()
    .id("mv_001")
    .index("idx_movies")
    .action(a -> a.doc(movie))
    .build();

var operation = new BulkOperation.Builder().update(updateOperation).build();

var bulkRequest = new BulkRequest.Builder().operations(List.of(operation)).build();

var response = client.bulk(bulkRequest);

Thanks.

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