Class DeleteRequestBuilder

All Implemented Interfaces:
WriteRequestBuilder<DeleteRequestBuilder>

public class DeleteRequestBuilder
extends ReplicationRequestBuilder<DeleteRequest,​DeleteResponse,​DeleteRequestBuilder>
implements WriteRequestBuilder<DeleteRequestBuilder>
A delete document action request builder.
  • Constructor Details

  • Method Details

    • setType

      public DeleteRequestBuilder setType​(java.lang.String type)
      Sets the type of the document to delete.
    • setId

      public DeleteRequestBuilder setId​(java.lang.String id)
      Sets the id of the document to delete.
    • setRouting

      public DeleteRequestBuilder setRouting​(java.lang.String routing)
      Controls the shard routing of the delete request. Using this value to hash the shard and not the id.
    • setVersion

      public DeleteRequestBuilder 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

      public DeleteRequestBuilder setVersionType​(VersionType versionType)
      Sets the type of versioning to use. Defaults to VersionType.INTERNAL.
    • setIfSeqNo

      public DeleteRequestBuilder setIfSeqNo​(long seqNo)
      only perform this delete request if the document was last modification was assigned the given sequence number. Must be used in combination with setIfPrimaryTerm(long) If the document last modification was assigned a different sequence number a VersionConflictEngineException will be thrown.
    • setIfPrimaryTerm

      public DeleteRequestBuilder setIfPrimaryTerm​(long term)
      only perform this delete request if the document was last modification was assigned the given primary term. Must be used in combination with setIfSeqNo(long) If the document last modification was assigned a different term a VersionConflictEngineException will be thrown.