New Java client how to estimate size of BulkRequest

Is there a efferent way to estimate the size of the bulk request in the new ElasticsearchClient ?

Currently our in the HighLevelRest-Client we use the method bulkRequest.estimatedSizeInBytes() to check whether another request would fit. If that is the case, we add another Request. If not, we send the former created BulkRequest to our Elasticsearch-Cluster. And start adding new Requests into a new BulkRequest instance.

But while migrating to the new ElasticsearchClient I did not find anything similar to that.

Since the Builders do only allow to be build once it might be wise to estimate the size of an BulkOperation instead and add them up before adding to the builder. But I did not find a solution for that either.

3 Likes

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