diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeRequest.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeRequest.java
index db73df372c9..a1ffba7f35f 100644
--- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeRequest.java
+++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/admin/indices/optimize/OptimizeRequest.java
@@ -49,9 +49,9 @@ public class OptimizeRequest extends BroadcastOperationRequest {
private boolean onlyExpungeDeletes = false;
- private boolean flush = false;
+ private boolean flush = true;
- private boolean refresh = false;
+ private boolean refresh = true;
/**
* Constructs an optimization request over one or more indices.
@@ -128,14 +128,14 @@ public class OptimizeRequest extends BroadcastOperationRequest {
}
/**
- * Should flush be performed after the optimization. Defaults to false.
+ * Should flush be performed after the optimization. Defaults to true.
*/
public boolean flush() {
return flush;
}
/**
- * Should flush be performed after the optimization. Defaults to false.
+ * Should flush be performed after the optimization. Defaults to true.
*/
public OptimizeRequest flush(boolean flush) {
this.flush = flush;
@@ -143,14 +143,14 @@ public class OptimizeRequest extends BroadcastOperationRequest {
}
/**
- * Should refresh be performed after the optimization. Defaults to false.
+ * Should refresh be performed after the optimization. Defaults to true.
*/
public boolean refresh() {
return refresh;
}
/**
- * Should refresh be performed after the optimization. Defaults to false.
+ * Should refresh be performed after the optimization. Defaults to true.
*/
public OptimizeRequest refresh(boolean refresh) {
this.refresh = refresh;