diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/core/DeleteByQueryRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/core/DeleteByQueryRequest.java
index e684435b8f..516f62060c 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/core/DeleteByQueryRequest.java
+++ b/java-client/src/main/java/org/opensearch/client/opensearch/core/DeleteByQueryRequest.java
@@ -509,7 +509,7 @@ public final SlicedScroll slice() {
/**
* The number of slices this task should be divided into. Defaults to 1, meaning
- * the task isn't sliced into subtasks. Can be set to auto
.
+ * the task isn't sliced into subtasks. Can be set to 0 for auto
.
*
* API name: {@code slices}
*/
@@ -1125,7 +1125,7 @@ public final Builder slice(Functionauto.
+ * the task isn't sliced into subtasks. Can be set to 0 for auto
.
*
* API name: {@code slices}
*/
@@ -1327,7 +1327,7 @@ protected static void setupDeleteByQueryRequestDeserializer(ObjectDeserializer {
Map params = new HashMap<>();
if (request.slices != null) {
- params.put("slices", String.valueOf(request.slices));
+ params.put("slices", request.slices == 0 ? "auto" : String.valueOf(request.slices));
}
if (request.df != null) {
params.put("df", request.df);
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/core/ReindexRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/core/ReindexRequest.java
index 4d15889524..fd105054e7 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/core/ReindexRequest.java
+++ b/java-client/src/main/java/org/opensearch/client/opensearch/core/ReindexRequest.java
@@ -219,7 +219,7 @@ public final Long size() {
/**
* The number of slices this task should be divided into. Defaults to 1, meaning
- * the task isn't sliced into subtasks. Can be set to auto
.
+ * the task isn't sliced into subtasks. Can be set to 0 for auto
.
*
* API name: {@code slices}
*/
@@ -467,7 +467,7 @@ public final Builder size(@Nullable Long value) {
/**
* The number of slices this task should be divided into. Defaults to 1, meaning
- * the task isn't sliced into subtasks. Can be set to auto
.
+ * the task isn't sliced into subtasks. Can be set to 0 for auto
.
*
* API name: {@code slices}
*/
@@ -605,7 +605,7 @@ protected static void setupReindexRequestDeserializer(ObjectDeserializer {
Map params = new HashMap<>();
if (request.slices != null) {
- params.put("slices", String.valueOf(request.slices));
+ params.put("slices", request.slices == 0 ? "auto" : String.valueOf(request.slices));
}
if (request.requestsPerSecond != null) {
params.put("requests_per_second", String.valueOf(request.requestsPerSecond));
diff --git a/java-client/src/main/java/org/opensearch/client/opensearch/core/UpdateByQueryRequest.java b/java-client/src/main/java/org/opensearch/client/opensearch/core/UpdateByQueryRequest.java
index 847e0e8bd7..f651b23696 100644
--- a/java-client/src/main/java/org/opensearch/client/opensearch/core/UpdateByQueryRequest.java
+++ b/java-client/src/main/java/org/opensearch/client/opensearch/core/UpdateByQueryRequest.java
@@ -525,7 +525,7 @@ public final SlicedScroll slice() {
/**
* The number of slices this task should be divided into. Defaults to 1, meaning
- * the task isn't sliced into subtasks. Can be set to auto
.
+ * the task isn't sliced into subtasks. Can be set to 0 for auto
.
*
* API name: {@code slices}
*/
@@ -1181,7 +1181,7 @@ public final Builder slice(Functionauto.
+ * the task isn't sliced into subtasks. Can be set to 0 for auto
.
*
* API name: {@code slices}
*/
@@ -1397,7 +1397,7 @@ protected static void setupUpdateByQueryRequestDeserializer(ObjectDeserializer {
Map params = new HashMap<>();
if (request.slices != null) {
- params.put("slices", String.valueOf(request.slices));
+ params.put("slices", request.slices == 0 ? "auto" : String.valueOf(request.slices));
}
if (request.df != null) {
params.put("df", request.df);