|
@@ -88,6 +88,7 @@ import org.elasticsearch.action.support.ActiveShardCount;
|
|
import org.elasticsearch.action.support.IndicesOptions;
|
|
import org.elasticsearch.action.support.IndicesOptions;
|
|
import org.elasticsearch.action.support.WriteRequest;
|
|
import org.elasticsearch.action.support.WriteRequest;
|
|
import org.elasticsearch.action.update.UpdateRequest;
|
|
import org.elasticsearch.action.update.UpdateRequest;
|
|
|
|
+import org.elasticsearch.client.security.RefreshPolicy;
|
|
import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
|
import org.elasticsearch.cluster.health.ClusterHealthStatus;
|
|
import org.elasticsearch.common.Nullable;
|
|
import org.elasticsearch.common.Nullable;
|
|
import org.elasticsearch.common.Priority;
|
|
import org.elasticsearch.common.Priority;
|
|
@@ -1353,11 +1354,16 @@ final class RequestConverters {
|
|
|
|
|
|
Params withRefresh(boolean refresh) {
|
|
Params withRefresh(boolean refresh) {
|
|
if (refresh) {
|
|
if (refresh) {
|
|
- return withRefreshPolicy(WriteRequest.RefreshPolicy.IMMEDIATE);
|
|
|
|
|
|
+ return withRefreshPolicy(RefreshPolicy.IMMEDIATE);
|
|
}
|
|
}
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @deprecated If creating a new HLRC ReST API call, use {@link RefreshPolicy}
|
|
|
|
+ * instead of {@link WriteRequest.RefreshPolicy} from the server project
|
|
|
|
+ */
|
|
|
|
+ @Deprecated
|
|
Params withRefreshPolicy(WriteRequest.RefreshPolicy refreshPolicy) {
|
|
Params withRefreshPolicy(WriteRequest.RefreshPolicy refreshPolicy) {
|
|
if (refreshPolicy != WriteRequest.RefreshPolicy.NONE) {
|
|
if (refreshPolicy != WriteRequest.RefreshPolicy.NONE) {
|
|
return putParam("refresh", refreshPolicy.getValue());
|
|
return putParam("refresh", refreshPolicy.getValue());
|
|
@@ -1365,6 +1371,13 @@ final class RequestConverters {
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Params withRefreshPolicy(RefreshPolicy refreshPolicy) {
|
|
|
|
+ if (refreshPolicy != RefreshPolicy.NONE) {
|
|
|
|
+ return putParam("refresh", refreshPolicy.getValue());
|
|
|
|
+ }
|
|
|
|
+ return this;
|
|
|
|
+ }
|
|
|
|
+
|
|
Params withRetryOnConflict(int retryOnConflict) {
|
|
Params withRetryOnConflict(int retryOnConflict) {
|
|
if (retryOnConflict > 0) {
|
|
if (retryOnConflict > 0) {
|
|
return putParam("retry_on_conflict", String.valueOf(retryOnConflict));
|
|
return putParam("retry_on_conflict", String.valueOf(retryOnConflict));
|