Package org.elasticsearch.index.reindex
Class UpdateByQueryRequest
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.index.reindex.AbstractBulkByScrollRequest<Self>
org.elasticsearch.index.reindex.AbstractBulkIndexByScrollRequest<UpdateByQueryRequest>
org.elasticsearch.index.reindex.UpdateByQueryRequest
- All Implemented Interfaces:
IndicesRequest
,IndicesRequest.Replaceable
,Writeable
,org.elasticsearch.common.xcontent.ToXContent
,org.elasticsearch.common.xcontent.ToXContentObject
,TaskAwareRequest
public class UpdateByQueryRequest extends AbstractBulkIndexByScrollRequest<UpdateByQueryRequest> implements IndicesRequest.Replaceable, org.elasticsearch.common.xcontent.ToXContentObject
Request to update some documents. That means you can't change their type, id, index, or anything like that. This implements
CompositeIndicesRequest but in a misleading way. Rather than returning all the subrequests that it will make it tries to return a
representative set of subrequests. This is best-effort but better than ReindexRequest because scripts can't change the
destination index and things.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
Nested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.Replaceable
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
Field Summary
Fields inherited from class org.elasticsearch.index.reindex.AbstractBulkByScrollRequest
AUTO_SLICES, AUTO_SLICES_VALUE, DEFAULT_SCROLL_SIZE, DEFAULT_SCROLL_TIMEOUT, MAX_DOCS_ALL_MATCHES, SIZE_ALL_MATCHES
-
Constructor Summary
Constructors Constructor Description UpdateByQueryRequest()
UpdateByQueryRequest(java.lang.String... indices)
UpdateByQueryRequest(StreamInput in)
-
Method Summary
Modifier and Type Method Description UpdateByQueryRequest
forSlice(TaskId slicingTask, SearchRequest slice, int totalSlices)
Build a new request for a slice of the parent request.int
getBatchSize()
Gets the batch size for this requestjava.lang.String[]
getDocTypes()
Deprecated.Types are in the process of being removed.java.lang.String
getPipeline()
Ingest pipeline to set on index requests made by this action.java.lang.String
getRouting()
Gets the routing value used for this requestjava.lang.String[]
indices()
Returns the array of indices that the action relates toIndicesRequest
indices(java.lang.String... indices)
Sets the indices that the action relates to.IndicesOptions
indicesOptions()
Returns the indices options used to resolve indices.protected UpdateByQueryRequest
self()
`this` cast to Self.UpdateByQueryRequest
setBatchSize(int size)
The scroll size to control number of documents processed per batchUpdateByQueryRequest
setDocTypes(java.lang.String... types)
Deprecated.Types are in the process of being removed.UpdateByQueryRequest
setIndicesOptions(IndicesOptions indicesOptions)
Set the IndicesOptions for controlling unavailable indicesUpdateByQueryRequest
setPipeline(java.lang.String pipeline)
Set the ingest pipeline to set on index requests made by this action.UpdateByQueryRequest
setQuery(QueryBuilder query)
Set the query for selective updateUpdateByQueryRequest
setRouting(java.lang.String routing)
Set routing limiting the process to the shards that match that routing valuejava.lang.String
toString()
org.elasticsearch.common.xcontent.XContentBuilder
toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.Methods inherited from class org.elasticsearch.index.reindex.AbstractBulkIndexByScrollRequest
doForSlice, getScript, searchToString, setScript
Methods inherited from class org.elasticsearch.index.reindex.AbstractBulkByScrollRequest
createTask, getDescription, getMaxDocs, getMaxRetries, getRequestsPerSecond, getRetryBackoffInitialTime, getScrollTime, getSearchRequest, getShouldStoreResult, getSize, getSlices, getTimeout, getWaitForActiveShards, isAbortOnVersionConflict, isRefresh, setAbortOnVersionConflict, setConflicts, setMaxDocs, setMaxRetries, setRefresh, setRequestsPerSecond, setRetryBackoffInitialTime, setScroll, setShouldStoreResult, setSize, setSlices, setTimeout, setTimeout, setWaitForActiveShards, setWaitForActiveShards, validate
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Constructor Details
-
UpdateByQueryRequest
public UpdateByQueryRequest() -
UpdateByQueryRequest
public UpdateByQueryRequest(java.lang.String... indices) -
UpdateByQueryRequest
- Throws:
java.io.IOException
-
-
Method Details
-
setPipeline
Set the ingest pipeline to set on index requests made by this action. -
setQuery
Set the query for selective update -
setDocTypes
Deprecated.Types are in the process of being removed. Instead of using a type, prefer to filter on a field of the document.Set the document types for the update -
setRouting
Set routing limiting the process to the shards that match that routing value -
setBatchSize
The scroll size to control number of documents processed per batch -
setIndicesOptions
Set the IndicesOptions for controlling unavailable indices -
getBatchSize
public int getBatchSize()Gets the batch size for this request -
getRouting
public java.lang.String getRouting()Gets the routing value used for this request -
getDocTypes
@Deprecated public java.lang.String[] getDocTypes()Deprecated.Types are in the process of being removed. Instead of using a type, prefer to filter on a field of the document.Gets the document types on which this request would be executed. Returns an empty array if all types are to be processed. -
getPipeline
public java.lang.String getPipeline()Ingest pipeline to set on index requests made by this action. -
self
Description copied from class:AbstractBulkByScrollRequest
`this` cast to Self. Used for building fluent methods without cast warnings.- Specified by:
self
in classAbstractBulkByScrollRequest<UpdateByQueryRequest>
-
forSlice
Description copied from class:AbstractBulkByScrollRequest
Build a new request for a slice of the parent request.- Specified by:
forSlice
in classAbstractBulkByScrollRequest<UpdateByQueryRequest>
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
indices
Description copied from interface:IndicesRequest.Replaceable
Sets the indices that the action relates to.- Specified by:
indices
in interfaceIndicesRequest.Replaceable
-
indices
public java.lang.String[] indices()Description copied from interface:IndicesRequest
Returns the array of indices that the action relates to- Specified by:
indices
in interfaceIndicesRequest
-
indicesOptions
Description copied from interface:IndicesRequest
Returns the indices options used to resolve indices. They tell for instance whether a single index is accepted, whether an empty array will be converted to _all, and how wildcards will be expanded if needed.- Specified by:
indicesOptions
in interfaceIndicesRequest
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classAbstractBulkIndexByScrollRequest<UpdateByQueryRequest>
- Throws:
java.io.IOException
-
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContent
in interfaceorg.elasticsearch.common.xcontent.ToXContent
- Throws:
java.io.IOException
-