Package org.elasticsearch.action
Interface DocWriteRequest<T>
- All Superinterfaces:
IndicesRequest
- All Known Implementing Classes:
DeleteRequest,IndexRequest,UpdateRequest
public interface DocWriteRequest<T> extends IndicesRequest
Generic interface to group ActionRequest, which perform writes to a single document
Action requests implementing this can be part of
BulkRequest-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classDocWriteRequest.OpTypeRequested operation type to perform on the documentNested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.Replaceable -
Method Summary
Modifier and Type Method Description TdefaultTypeIfNull(java.lang.String defaultType)Set the default type supplied to a bulk request if this individual request's type is null or emptyjava.lang.Stringid()Get the id of the document for this requestlongifPrimaryTerm()If set, only perform this request if the document was last modification was assigned this primary term.longifSeqNo()If set, only perform this request if the document was last modification was assigned this sequence number.java.lang.Stringindex()Get the index that this request operates onTindex(java.lang.String index)Set the index for this requestIndicesOptionsindicesOptions()Get the options for this requestDocWriteRequest.OpTypeopType()Get the requested document operation type of the requeststatic DocWriteRequest<?>readDocumentRequest(StreamInput in)read a document write (index/delete/update) requestjava.lang.Stringrouting()Get the routing for this requestTrouting(java.lang.String routing)Set the routing for this requestTsetIfPrimaryTerm(long term)only performs this request if the document was last modification was assigned the given primary term.TsetIfSeqNo(long seqNo)only perform this request if the document was last modification was assigned the given sequence number.java.lang.Stringtype()Get the type that this request operates onTtype(java.lang.String type)Set the type for this requeststatic ActionRequestValidationExceptionvalidateSeqNoBasedCASParams(DocWriteRequest request, ActionRequestValidationException validationException)longversion()Get the document version for this requestTversion(long version)Sets the version, which will perform the operation only if a matching version exists and no changes happened on the doc since then.VersionTypeversionType()Get the document version type for this requestTversionType(VersionType versionType)Sets the versioning type.static voidwriteDocumentRequest(StreamOutput out, DocWriteRequest<?> request)write a document write (index/delete/update) request
-
Method Details
-
index
Set the index for this request- Returns:
- the Request
-
index
java.lang.String index()Get the index that this request operates on- Returns:
- the index
-
type
Set the type for this request- Returns:
- the Request
-
type
java.lang.String type()Get the type that this request operates on- Returns:
- the type
-
defaultTypeIfNull
Set the default type supplied to a bulk request if this individual request's type is null or empty- Returns:
- the Request
-
id
java.lang.String id()Get the id of the document for this request- Returns:
- the id
-
indicesOptions
IndicesOptions indicesOptions()Get the options for this request- Specified by:
indicesOptionsin interfaceIndicesRequest- Returns:
- the indices options
-
routing
Set the routing for this request- Returns:
- the Request
-
routing
java.lang.String routing()Get the routing for this request- Returns:
- the Routing
-
version
long version()Get the document version for this request- Returns:
- the document version
-
version
Sets the version, which will perform the operation only if a matching version exists and no changes happened on the doc since then. -
versionType
VersionType versionType()Get the document version type for this request- Returns:
- the document version type
-
versionType
Sets the versioning type. Defaults toVersionType.INTERNAL. -
setIfSeqNo
only perform this 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 performs this 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. -
ifSeqNo
long ifSeqNo()If set, only perform this request if the document was last modification was assigned this sequence number. If the document last modification was assigned a different sequence number aVersionConflictEngineExceptionwill be thrown. -
ifPrimaryTerm
long ifPrimaryTerm()If set, only perform this request if the document was last modification was assigned this primary term. If the document last modification was assigned a different term aVersionConflictEngineExceptionwill be thrown. -
opType
DocWriteRequest.OpType opType()Get the requested document operation type of the request- Returns:
- the operation type
DocWriteRequest.OpType
-
readDocumentRequest
read a document write (index/delete/update) request- Throws:
java.io.IOException
-
writeDocumentRequest
static void writeDocumentRequest(StreamOutput out, DocWriteRequest<?> request) throws java.io.IOExceptionwrite a document write (index/delete/update) request- Throws:
java.io.IOException
-
validateSeqNoBasedCASParams
static ActionRequestValidationException validateSeqNoBasedCASParams(DocWriteRequest request, ActionRequestValidationException validationException)
-