Package org.elasticsearch.index.reindex
Class DeleteByQueryRequest
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.action.ActionRequest
-
- org.elasticsearch.index.reindex.AbstractBulkByScrollRequest<DeleteByQueryRequest>
-
- org.elasticsearch.index.reindex.DeleteByQueryRequest
-
- All Implemented Interfaces:
IndicesRequest
,IndicesRequest.Replaceable
,Streamable
,Writeable
,TaskAwareRequest
public class DeleteByQueryRequest extends AbstractBulkByScrollRequest<DeleteByQueryRequest> implements IndicesRequest.Replaceable
Creates a newDeleteByQueryRequest
that uses scrolling and bulk requests to delete all documents matching the query. This can have performance as well as visibility implications. Delete-by-query now has the following semantics:- it's
non-atomic
, a delete-by-query may fail at any time while some documents matching the query have already been deleted - it's
syntactic sugar
, a delete-by-query is equivalent to a scroll search and corresponding bulk-deletes by ID - it's executed on a
point-in-time
snapshot, a delete-by-query will only delete the documents that are visible at the point in time the delete-by-query was started, equivalent to the scroll API - it's
consistent
, a delete-by-query will yield consistent results across all replicas of a shard - it's
forward-compatible
, a delete-by-query will only send IDs to the shards as deletes such that no queries are stored in the transaction logs that might not be supported in the future. - it's results won't be visible until the index is refreshed.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.elasticsearch.action.IndicesRequest
IndicesRequest.Replaceable
-
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
-
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, SIZE_ALL_MATCHES
-
-
Constructor Summary
Constructors Constructor Description DeleteByQueryRequest()
DeleteByQueryRequest(SearchRequest search)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeleteByQueryRequest
forSlice(TaskId slicingTask, SearchRequest slice, int totalSlices)
Build a new request for a slice of the parent request.java.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 DeleteByQueryRequest
self()
`this` cast to Self.java.lang.String
toString()
java.lang.String[]
types()
DeleteByQueryRequest
types(java.lang.String... types)
ActionRequestValidationException
validate()
-
Methods inherited from class org.elasticsearch.index.reindex.AbstractBulkByScrollRequest
createTask, doForSlice, getDescription, getMaxRetries, getRequestsPerSecond, getRetryBackoffInitialTime, getScrollTime, getSearchRequest, getShouldStoreResult, getSize, getSlices, getTimeout, getWaitForActiveShards, isAbortOnVersionConflict, isRefresh, readFrom, searchToString, setAbortOnVersionConflict, setConflicts, setMaxRetries, setRefresh, setRequestsPerSecond, setRetryBackoffInitialTime, setScroll, setShouldStoreResult, setSize, setSlices, setTimeout, setWaitForActiveShards, setWaitForActiveShards, writeTo
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.common.io.stream.Streamable
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
setParentTask
-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask
-
-
-
-
Constructor Detail
-
DeleteByQueryRequest
public DeleteByQueryRequest()
-
DeleteByQueryRequest
public DeleteByQueryRequest(SearchRequest search)
-
-
Method Detail
-
self
protected DeleteByQueryRequest self()
Description copied from class:AbstractBulkByScrollRequest
`this` cast to Self. Used for building fluent methods without cast warnings.- Specified by:
self
in classAbstractBulkByScrollRequest<DeleteByQueryRequest>
-
validate
public ActionRequestValidationException validate()
- Overrides:
validate
in classAbstractBulkByScrollRequest<DeleteByQueryRequest>
-
forSlice
public DeleteByQueryRequest forSlice(TaskId slicingTask, SearchRequest slice, int totalSlices)
Description copied from class:AbstractBulkByScrollRequest
Build a new request for a slice of the parent request.- Specified by:
forSlice
in classAbstractBulkByScrollRequest<DeleteByQueryRequest>
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
indices
public IndicesRequest indices(java.lang.String... 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
public IndicesOptions 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
-
types
public java.lang.String[] types()
-
types
public DeleteByQueryRequest types(java.lang.String... types)
-
-