Package org.elasticsearch.action.delete
Class DeleteRequestBuilder
org.elasticsearch.action.ActionRequestBuilder<Request,Response>
org.elasticsearch.action.support.replication.ReplicationRequestBuilder<DeleteRequest,DeleteResponse,DeleteRequestBuilder>
org.elasticsearch.action.delete.DeleteRequestBuilder
- All Implemented Interfaces:
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.ActionRequestBuilder
action, client, request
-
Constructor Summary
ConstructorDescriptionDeleteRequestBuilder(ElasticsearchClient client, DeleteAction action)
DeleteRequestBuilder(ElasticsearchClient client, DeleteAction action, index)
-
Method Summary
Modifier and TypeMethodDescriptionid)
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.routing)
Controls the shard routing of the delete request.type)
Sets the type of the document to delete.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
setIndex, setTimeout, setTimeout, setWaitForActiveShards, setWaitForActiveShards
Methods inherited from class org.elasticsearch.action.ActionRequestBuilder
execute, execute, get, get, get, request
Methods inherited from class java.lang.
, , , , , , , , , ,
Methods inherited from interface org.elasticsearch.action.support.WriteRequestBuilder
request, setRefreshPolicy, setRefreshPolicy
-
Constructor Details
-
DeleteRequestBuilder
-
DeleteRequestBuilder
-
-
Method Details
-
setType
public type)Sets the type of the document to delete. -
setId
public id)Sets the id of the document to delete. -
setRouting
public routing)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 aVersionConflictEngineException
will 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 aVersionConflictEngineException
will be thrown.
-