java.lang.Object
org.elasticsearch.action.ActionRequestLazyBuilder<DeleteRequest,DeleteResponse>
org.elasticsearch.action.support.replication.ReplicationRequestBuilder<DeleteRequest,DeleteResponse,DeleteRequestBuilder>
org.elasticsearch.action.delete.DeleteRequestBuilder
- All Implemented Interfaces:
RequestBuilder<DeleteRequest,,DeleteResponse> WriteRequestBuilder<DeleteRequestBuilder>
public class DeleteRequestBuilder
extends ReplicationRequestBuilder<DeleteRequest,DeleteResponse,DeleteRequestBuilder>
implements WriteRequestBuilder<DeleteRequestBuilder>
A delete document action request builder.
-
Field Summary
Fields inherited from class org.elasticsearch.action.ActionRequestLazyBuilder
action, client -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionrequest()This method creates the request.Sets the id of the document to delete.setIfPrimaryTerm(long term) only perform this delete request if the document was last modification was assigned the given primary term.setIfSeqNo(long seqNo) only perform this delete request if the document was last modification was assigned the given sequence number.setRefreshPolicy(String refreshPolicy) Parse the refresh policy from a string, only modifying it if the string is non null.setRefreshPolicy(WriteRequest.RefreshPolicy refreshPolicy) Should this request trigger a refresh (WriteRequest.RefreshPolicy.IMMEDIATE), wait for a refresh ( WriteRequest.RefreshPolicy.WAIT_UNTIL), or proceed ignore refreshes entirely (WriteRequest.RefreshPolicy.NONE, the default).setRouting(String routing) Controls the shard routing of the delete request.setVersion(long version) Sets the version, which will cause the delete operation to only be performed if a matching version exists and no changes happened on the doc since then.setVersionType(VersionType versionType) Sets the type of versioning to use.Methods inherited from class org.elasticsearch.action.support.replication.ReplicationRequestBuilder
apply, getIndex, setIndex, setTimeout, setWaitForActiveShards, setWaitForActiveShardsMethods inherited from class org.elasticsearch.action.ActionRequestLazyBuilder
execute, execute, get, get
-
Constructor Details
-
DeleteRequestBuilder
-
-
Method Details
-
setId
Sets the id of the document to delete. -
setRouting
Controls the shard routing of the delete request. Using this value to hash the shard and not the id. -
setVersion
Sets the version, which will cause the delete operation to only be performed if a matching version exists and no changes happened on the doc since then. -
setVersionType
Sets the type of versioning to use. Defaults toVersionType.INTERNAL. -
setIfSeqNo
only perform this delete request if the document was last modification was assigned the given sequence number. Must be used in combination withsetIfPrimaryTerm(long)If the document last modification was assigned a different sequence number aVersionConflictEngineExceptionwill be thrown. -
setIfPrimaryTerm
only perform this delete request if the document was last modification was assigned the given primary term. Must be used in combination withsetIfSeqNo(long)If the document last modification was assigned a different term aVersionConflictEngineExceptionwill be thrown. -
setRefreshPolicy
Description copied from interface:WriteRequestBuilderShould this request trigger a refresh (WriteRequest.RefreshPolicy.IMMEDIATE), wait for a refresh ( WriteRequest.RefreshPolicy.WAIT_UNTIL), or proceed ignore refreshes entirely (WriteRequest.RefreshPolicy.NONE, the default).- Specified by:
setRefreshPolicyin interfaceWriteRequestBuilder<DeleteRequestBuilder>
-
setRefreshPolicy
Description copied from interface:WriteRequestBuilderParse the refresh policy from a string, only modifying it if the string is non null. Convenient to use with request parsing.- Specified by:
setRefreshPolicyin interfaceWriteRequestBuilder<DeleteRequestBuilder>
-
request
Description copied from class:ActionRequestLazyBuilderThis method creates the request. The caller of this method is responsible for calling Request#decRef.- Specified by:
requestin interfaceRequestBuilder<DeleteRequest,DeleteResponse> - Specified by:
requestin interfaceWriteRequestBuilder<DeleteRequestBuilder>- Specified by:
requestin classActionRequestLazyBuilder<DeleteRequest,DeleteResponse> - Returns:
- A newly-built Request, fully initialized by this builder.
-