Elasticsearch-java api for Slices doesn't have a way to specify 'auto' for reindexing?

It seems that Slices.java in v8 and v9 of the elasticsearch-java, there is no way to specify slices = 'auto'?

The REST API seems to to say 'auto' can be used (Reindex documents | Elasticsearch API documentation)

But the java api doesn't seem to have it.

Can someone confirm? If it indeed does not have a java binding, is there a workaround?

Hello!

Since the slice field in the ReindexDocument request can accept both integers and the “auto” string, in the java client it needs an extra step to be set, to identify the correct type. So to set “auto” you can use:

Slices.of(s -> s.computed(SlicesCalculation.Auto));

and it’s the same for both 8.x and 9.x :slight_smile:

wow, great, I thought this thread was dead! thank you so much I will have to give it a try

so sorry for the delay :folded_hands: