public class DeleteRequest extends ReplicationRequest<DeleteRequest> implements DocumentRequest<DeleteRequest>
Requests.deleteRequest(String)
.
The operation requires the ReplicationRequest.index()
, type(String)
and id(String)
to
be set.
TransportRequest.Empty
IndicesRequest.Replaceable
DEFAULT_TIMEOUT, index, shardId, timeout
Constructor and Description |
---|
DeleteRequest() |
DeleteRequest(java.lang.String index)
Constructs a new delete request against the specified index.
|
DeleteRequest(java.lang.String index,
java.lang.String type,
java.lang.String id)
Constructs a new delete request against the specified index with the type and id.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
id()
The id of the document to delete.
|
DeleteRequest |
id(java.lang.String id)
Sets the id of the document to delete.
|
java.lang.String |
parent()
Get the parent for this request
|
DeleteRequest |
parent(java.lang.String parent)
Sets the parent id of this document.
|
void |
readFrom(StreamInput in)
Set this object's fields from a StreamInput.
|
boolean |
refresh() |
DeleteRequest |
refresh(boolean refresh)
Should a refresh be executed post this index operation causing the operation to
be searchable.
|
java.lang.String |
routing()
Controls the shard routing of the delete request.
|
DeleteRequest |
routing(java.lang.String routing)
Controls the shard routing of the request.
|
java.lang.String |
toString() |
java.lang.String |
type()
The type of the document to delete.
|
DeleteRequest |
type(java.lang.String type)
Sets the type of the document to delete.
|
ActionRequestValidationException |
validate() |
long |
version() |
DeleteRequest |
version(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.
|
VersionType |
versionType() |
DeleteRequest |
versionType(VersionType versionType) |
void |
writeTo(StreamOutput out)
Write this object's fields to a StreamOutput.
|
consistencyLevel, consistencyLevel, createTask, getDescription, index, index, indices, indicesOptions, primaryTerm, primaryTerm, setShardId, shardId, timeout, timeout, timeout
createTask, setParentTask
remoteAddress, remoteAddress
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
index, indicesOptions
indices
public DeleteRequest()
public DeleteRequest(java.lang.String index)
type(String)
and id(String)
must be set.public DeleteRequest(java.lang.String index, java.lang.String type, java.lang.String id)
index
- The index to get the document fromtype
- The type of the documentid
- The id of the documentpublic ActionRequestValidationException validate()
validate
in class ReplicationRequest<DeleteRequest>
public java.lang.String type()
type
in interface DocumentRequest<DeleteRequest>
public DeleteRequest type(java.lang.String type)
public java.lang.String id()
id
in interface DocumentRequest<DeleteRequest>
public DeleteRequest id(java.lang.String id)
public java.lang.String parent()
DocumentRequest
parent
in interface DocumentRequest<DeleteRequest>
public DeleteRequest parent(java.lang.String parent)
public DeleteRequest routing(java.lang.String routing)
routing
in interface DocumentRequest<DeleteRequest>
public java.lang.String routing()
routing
in interface DocumentRequest<DeleteRequest>
public DeleteRequest refresh(boolean refresh)
public boolean refresh()
public DeleteRequest version(long version)
public long version()
public DeleteRequest versionType(VersionType versionType)
public VersionType versionType()
public void readFrom(StreamInput in) throws java.io.IOException
Streamable
readFrom
in interface Streamable
readFrom
in class ReplicationRequest<DeleteRequest>
java.io.IOException
public void writeTo(StreamOutput out) throws java.io.IOException
Streamable
writeTo
in interface Streamable
writeTo
in class ReplicationRequest<DeleteRequest>
java.io.IOException
public java.lang.String toString()
toString
in class ReplicationRequest<DeleteRequest>