java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.AbstractTransportRequest
org.elasticsearch.action.ActionRequest
org.elasticsearch.action.LegacyActionRequest
org.elasticsearch.index.reindex.AbstractBulkByScrollRequest<UpdateByQueryRequest>
org.elasticsearch.index.reindex.AbstractBulkIndexByScrollRequest<UpdateByQueryRequest>
org.elasticsearch.index.reindex.UpdateByQueryRequest
- All Implemented Interfaces:
IndicesRequest,IndicesRequest.Replaceable,Writeable,RefCounted,TaskAwareRequest,TransportRequest,ToXContent,ToXContentObject
public class UpdateByQueryRequest
extends AbstractBulkIndexByScrollRequest<UpdateByQueryRequest>
implements IndicesRequest.Replaceable, 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 interface org.elasticsearch.action.IndicesRequest
IndicesRequest.RemoteClusterShardRequest, IndicesRequest.Replaceable, IndicesRequest.SingleIndexNoWildcardsNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested 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_MATCHESFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCEDFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionforSlice(TaskId slicingTask, SearchRequest slice, int totalSlices) Build a new request for a slice of the parent request.intGets the batch size for this requestIngest pipeline to set on index requests made by this action.Gets the routing value used for this requestbooleanDetermines whether the request should be applied to data streams.String[]indices()Returns the array of indices that the action relates toSets the indices that the action relates to.Returns the indices options used to resolve indices.protected UpdateByQueryRequestself()`this` cast to Self.setBatchSize(int size) The scroll size to control number of documents processed per batchsetIndicesOptions(IndicesOptions indicesOptions) Set the IndicesOptions for controlling unavailable indicessetPipeline(String pipeline) Set the ingest pipeline to set on index requests made by this action.setQuery(QueryBuilder query) Set the query for selective updatesetRouting(String routing) Set routing limiting the process to the shards that match that routing valuetoString()toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.index.reindex.AbstractBulkIndexByScrollRequest
doForSlice, getScript, searchToString, setScriptMethods inherited from class org.elasticsearch.index.reindex.AbstractBulkByScrollRequest
createTask, getDescription, getMaxDocs, getMaxRetries, getRequestsPerSecond, getRetryBackoffInitialTime, getScrollTime, getSearchRequest, getShouldStoreResult, getSlices, getTimeout, getWaitForActiveShards, isAbortOnVersionConflict, isRefresh, setAbortOnVersionConflict, setConflicts, setMaxDocs, setMaxRetries, setRefresh, setRequestsPerSecond, setRetryBackoffInitialTime, setScroll, setShouldStoreResult, setSlices, setTimeout, setWaitForActiveShards, setWaitForActiveShards, validateMethods inherited from class org.elasticsearch.transport.AbstractTransportRequest
getParentTask, getRequestId, remoteAddress, remoteAddress, setParentTask, setRequestIdMethods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, tryIncRefMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.action.IndicesRequest.Replaceable
allowsRemoteIndicesMethods inherited from interface org.elasticsearch.core.RefCounted
decRef, hasReferences, incRef, mustIncRef, tryIncRefMethods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, setParentTaskMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
UpdateByQueryRequest
public UpdateByQueryRequest() -
UpdateByQueryRequest
-
UpdateByQueryRequest
- Throws:
IOException
-
-
Method Details
-
setPipeline
Set the ingest pipeline to set on index requests made by this action. -
setQuery
Set the query for selective 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
Gets the routing value used for this request -
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:
selfin classAbstractBulkByScrollRequest<UpdateByQueryRequest>
-
includeDataStreams
public boolean includeDataStreams()Description copied from interface:IndicesRequestDetermines whether the request should be applied to data streams. Whenfalse, none of the names or wildcard expressions inIndicesRequest.indices()should be applied to or expanded to any data streams. All layers involved in the request's fulfillment including security, name resolution, etc., should respect this flag.- Specified by:
includeDataStreamsin interfaceIndicesRequest
-
forSlice
Description copied from class:AbstractBulkByScrollRequestBuild a new request for a slice of the parent request.- Specified by:
forSlicein classAbstractBulkByScrollRequest<UpdateByQueryRequest>
-
toString
- Overrides:
toStringin classAbstractTransportRequest
-
indices
Description copied from interface:IndicesRequest.ReplaceableSets the indices that the action relates to.- Specified by:
indicesin interfaceIndicesRequest.Replaceable
-
indices
Description copied from interface:IndicesRequestReturns the array of indices that the action relates to- Specified by:
indicesin interfaceIndicesRequest
-
indicesOptions
Description copied from interface:IndicesRequestReturns 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:
indicesOptionsin interfaceIndicesRequest
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classAbstractBulkIndexByScrollRequest<UpdateByQueryRequest>- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-