Package org.elasticsearch.client.indices
Class CloseIndexRequest
java.lang.Object
org.elasticsearch.client.TimedRequest
org.elasticsearch.client.indices.CloseIndexRequest
- All Implemented Interfaces:
Validatable
A request to close an index.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.elasticsearch.action.support.IndicesOptionsFields inherited from class org.elasticsearch.client.TimedRequest
DEFAULT_ACK_TIMEOUT, DEFAULT_MASTER_NODE_TIMEOUTFields inherited from interface org.elasticsearch.client.Validatable
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionString[]indices()Returns the indices to closeorg.elasticsearch.action.support.IndicesOptionsSpecifies what type of requested indices to ignore and how to deal with wildcard expressions.indicesOptions(org.elasticsearch.action.support.IndicesOptions indicesOptions) Specifies what type of requested indices to ignore and how to deal with wildcard expressions.validate()Perform validation.org.elasticsearch.action.support.ActiveShardCountReturns the wait for active shard count or null if the default should be usedwaitForActiveShards(org.elasticsearch.action.support.ActiveShardCount waitForActiveShards) Sets the number of shard copies that should be active before a close-index request returns.Methods inherited from class org.elasticsearch.client.TimedRequest
masterNodeTimeout, setMasterTimeout, setTimeout, timeout
-
Field Details
-
DEFAULT_INDICES_OPTIONS
public static final org.elasticsearch.action.support.IndicesOptions DEFAULT_INDICES_OPTIONS
-
-
Constructor Details
-
CloseIndexRequest
Creates a new close index request- Parameters:
indices- the indices to close
-
-
Method Details
-
indices
Returns the indices to close -
indicesOptions
public org.elasticsearch.action.support.IndicesOptions indicesOptions()Specifies what type of requested indices to ignore and how to deal with wildcard expressions. For example indices that don't exist.- Returns:
- the current behaviour when it comes to index names and wildcard indices expressions
-
indicesOptions
public CloseIndexRequest indicesOptions(org.elasticsearch.action.support.IndicesOptions indicesOptions) Specifies what type of requested indices to ignore and how to deal with wildcard expressions. For example indices that don't exist.- Parameters:
indicesOptions- the desired behaviour regarding indices to ignore and wildcard indices expressions
-
waitForActiveShards
public org.elasticsearch.action.support.ActiveShardCount waitForActiveShards()Returns the wait for active shard count or null if the default should be used -
waitForActiveShards
public CloseIndexRequest waitForActiveShards(org.elasticsearch.action.support.ActiveShardCount waitForActiveShards) Sets the number of shard copies that should be active before a close-index request returns. Defaults tonull, which means not to wait. However the default behaviour is deprecated and will change in version 8. You can opt-in to the new default behaviour now by setting this toActiveShardCount.DEFAULT, which will wait according to the settingindex.write.wait_for_active_shardswhich by default will wait for one shard, the primary. Set this value toActiveShardCount.ALLto wait for all shards (primary and all replicas) to be active before returning. Otherwise, useActiveShardCount.from(int)to set this value to any non-negative integer up to the number of copies per shard (number of replicas + 1), to wait for the desired amount of shard copies to become active before returning. To explicitly preserve today's default behaviour and suppress the deprecation warning, set this property toActiveShardCount.from(0).- Parameters:
waitForActiveShards- number of active shard copies to wait on
-
validate
Description copied from interface:ValidatablePerform validation. This method does not have to be overridden in the event that no validation needs to be done, or the validation was done during object construction time. AValidationExceptionthat is not null is assumed to contain validation errors and will be thrown.- Specified by:
validatein interfaceValidatable- Returns:
- An
OptionalValidationExceptionthat contains a list of validation errors.
-