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
headers
Constructor and Description |
---|
DeleteRequest() |
DeleteRequest(ActionRequest request)
Creates a delete request caused by some other request, which is provided as an
argument so that its headers and context can be copied to the new request
|
DeleteRequest(DeleteRequest request)
Copy constructor that creates a new delete request that is a copy of the one provided as an argument.
|
DeleteRequest(DeleteRequest request,
ActionRequest originalRequest)
Copy constructor that creates a new delete request that is a copy of the one provided as an argument.
|
DeleteRequest(String index)
Constructs a new delete request against the specified index.
|
DeleteRequest(String index,
String type,
String id)
Constructs a new delete request against the specified index with the type and id.
|
Modifier and Type | Method and Description |
---|---|
String |
id()
The id of the document to delete.
|
DeleteRequest |
id(String id)
Sets the id of the document to delete.
|
DeleteRequest |
parent(String parent)
Sets the parent id of this document.
|
void |
readFrom(StreamInput in) |
boolean |
refresh() |
DeleteRequest |
refresh(boolean refresh)
Should a refresh be executed post this index operation causing the operation to
be searchable.
|
String |
routing()
Controls the shard routing of the delete request.
|
DeleteRequest |
routing(String routing)
Controls the shard routing of the request.
|
String |
toString() |
String |
type()
The type of the document to delete.
|
DeleteRequest |
type(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) |
canHaveDuplicates, consistencyLevel, consistencyLevel, createTask, getDescription, index, index, indices, indicesOptions, setShardId, shardId, timeout, timeout, timeout
createTask, setParentTask
remoteAddress, remoteAddress
contextSize, copyContextAndHeadersFrom, copyContextFrom, copyHeadersFrom, getContext, getFromContext, getFromContext, getHeader, getHeaders, hasHeader, hasInContext, isContextEmpty, putAllInContext, putHeader, putInContext
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
index, indicesOptions
indices
public DeleteRequest()
public DeleteRequest(String index)
type(String)
and id(String)
must be set.public DeleteRequest(String index, String type, String id)
index
- The index to get the document fromtype
- The type of the documentid
- The id of the documentpublic DeleteRequest(DeleteRequest request)
public DeleteRequest(DeleteRequest request, ActionRequest originalRequest)
public DeleteRequest(ActionRequest request)
public ActionRequestValidationException validate()
validate
in class ReplicationRequest<DeleteRequest>
public String type()
type
in interface DocumentRequest<DeleteRequest>
public DeleteRequest type(String type)
public String id()
id
in interface DocumentRequest<DeleteRequest>
public DeleteRequest id(String id)
public DeleteRequest parent(String parent)
public DeleteRequest routing(String routing)
routing
in interface DocumentRequest<DeleteRequest>
public 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 IOException
readFrom
in interface Streamable
readFrom
in class ReplicationRequest<DeleteRequest>
IOException
public void writeTo(StreamOutput out) throws IOException
writeTo
in interface Streamable
writeTo
in class ReplicationRequest<DeleteRequest>
IOException
public String toString()
toString
in class ReplicationRequest<DeleteRequest>
Copyright © 2009–2016. All rights reserved.