Class DeleteByQueryRequest
java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.core.DeleteByQueryRequest
- All Implemented Interfaces:
JsonpSerializable
@JsonpDeserializable
public class DeleteByQueryRequest
extends RequestBase
implements JsonpSerializable
Deletes documents that match the specified query.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class co.elastic.clients.elasticsearch._types.RequestBase
RequestBase.AbstractBuilder<BuilderT extends RequestBase.AbstractBuilder<BuilderT>> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final JsonpDeserializer<DeleteByQueryRequest>Json deserializer forDeleteByQueryRequeststatic final Endpoint<DeleteByQueryRequest,DeleteByQueryResponse, ErrorResponse> Endpoint "delete_by_query". -
Method Summary
Modifier and TypeMethodDescriptionfinal BooleanIffalse, the request returns an error if any wildcard expression, index alias, or_allvalue targets only missing or closed indices.final Stringanalyzer()Analyzer to use for the query string.final BooleanIftrue, wildcard and prefix queries are analyzed.final ConflictsWhat to do if delete by query hits version conflicts:abortorproceed.final OperatorThe default operator for query string query:ANDorOR.final Stringdf()Field to use as default where no field prefix is given in the query string.final List<ExpandWildcard>Type of index that wildcard patterns can match.final Longfrom()Starting offset (default: 0)final BooleanIffalse, the request returns an error if it targets a missing or closed index.index()Required - Comma-separated list of data streams, indices, and aliases to search.final Booleanlenient()Iftrue, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.final LongmaxDocs()The maximum number of documents to delete.static DeleteByQueryRequestfinal StringSpecifies the node or shard the operation should be performed on.final Stringq()Query in the Lucene query string syntax.final Queryquery()Specifies the documents to delete using the Query DSL.final Booleanrefresh()Iftrue, Elasticsearch refreshes all shards involved in the delete by query after the request completes.final BooleanIftrue, the request cache is used for this request.final FloatThe throttle for this request in sub-requests per second.final Stringrouting()Custom value used to route operations to a specific shard.final Timescroll()Period to retain the search context for scrolling.final LongSize of the scroll request that powers the operation.final TimeExplicit timeout for each search request.final SearchTypeThe type of the search operation.voidserialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) Serialize this object to JSON.protected voidserializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper) protected static voidfinal SlicedScrollslice()Slice the request manually using the provided slice ID and total number of slices.final Slicesslices()The number of slices this task should be divided into.sort()A comma-separated list of <field>:<direction> pairs.stats()Specifictagof the request for logging and statistical purposes.final LongMaximum number of documents to collect for each shard.final Timetimeout()Period each deletion request waits for active shards.final Booleanversion()Iftrue, returns the document version as part of a hit.final WaitForActiveShardsThe number of shard copies that must be active before proceeding with the operation.final BooleanIftrue, the request blocks until the operation is complete.Methods inherited from class co.elastic.clients.elasticsearch._types.RequestBase
toString
-
Field Details
-
_DESERIALIZER
Json deserializer forDeleteByQueryRequest -
_ENDPOINT
Endpoint "delete_by_query".
-
-
Method Details
-
of
public static DeleteByQueryRequest of(Function<DeleteByQueryRequest.Builder, ObjectBuilder<DeleteByQueryRequest>> fn) -
allowNoIndices
Iffalse, the request returns an error if any wildcard expression, index alias, or_allvalue targets only missing or closed indices. This behavior applies even if the request targets other open indices. For example, a request targetingfoo*,bar*returns an error if an index starts withfoobut no index starts withbar.API name:
allow_no_indices -
analyzeWildcard
Iftrue, wildcard and prefix queries are analyzed.API name:
analyze_wildcard -
analyzer
Analyzer to use for the query string.API name:
analyzer -
conflicts
What to do if delete by query hits version conflicts:abortorproceed.API name:
conflicts -
defaultOperator
The default operator for query string query:ANDorOR.API name:
default_operator -
df
Field to use as default where no field prefix is given in the query string.API name:
df -
expandWildcards
Type of index that wildcard patterns can match. If the request can target data streams, this argument determines whether wildcard expressions match hidden data streams. Supports comma-separated values, such asopen,hidden. Valid values are:all,open,closed,hidden,none.API name:
expand_wildcards -
from
Starting offset (default: 0)API name:
from -
index
Required - Comma-separated list of data streams, indices, and aliases to search. Supports wildcards (*). To search all data streams or indices, omit this parameter or use*or_all.API name:
index -
lenient
Iftrue, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.API name:
lenient -
maxDocs
The maximum number of documents to delete.API name:
max_docs -
preference
Specifies the node or shard the operation should be performed on. Random by default.API name:
preference -
q
Query in the Lucene query string syntax.API name:
q -
query
Specifies the documents to delete using the Query DSL.API name:
query -
refresh
Iftrue, Elasticsearch refreshes all shards involved in the delete by query after the request completes.API name:
refresh -
requestCache
Iftrue, the request cache is used for this request. Defaults to the index-level setting.API name:
request_cache -
requestsPerSecond
The throttle for this request in sub-requests per second.API name:
requests_per_second -
routing
Custom value used to route operations to a specific shard.API name:
routing -
scroll
Period to retain the search context for scrolling.API name:
scroll -
scrollSize
Size of the scroll request that powers the operation.API name:
scroll_size -
searchTimeout
Explicit timeout for each search request. Defaults to no timeout.API name:
search_timeout -
searchType
The type of the search operation. Available options:query_then_fetch,dfs_query_then_fetch.API name:
search_type -
slice
Slice the request manually using the provided slice ID and total number of slices.API name:
slice -
slices
The number of slices this task should be divided into.API name:
slices -
sort
A comma-separated list of <field>:<direction> pairs.API name:
sort -
stats
Specifictagof the request for logging and statistical purposes.API name:
stats -
terminateAfter
Maximum number of documents to collect for each shard. If a query reaches this limit, Elasticsearch terminates the query early. Elasticsearch collects documents before sorting. Use with caution. Elasticsearch applies this parameter to each shard handling the request. When possible, let Elasticsearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indices across multiple data tiers.API name:
terminate_after -
timeout
Period each deletion request waits for active shards.API name:
timeout -
version
Iftrue, returns the document version as part of a hit.API name:
version -
waitForActiveShards
The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index (number_of_replicas+1).API name:
wait_for_active_shards -
waitForCompletion
Iftrue, the request blocks until the operation is complete.API name:
wait_for_completion -
serialize
Serialize this object to JSON.- Specified by:
serializein interfaceJsonpSerializable
-
serializeInternal
-
setupDeleteByQueryRequestDeserializer
protected static void setupDeleteByQueryRequestDeserializer(ObjectDeserializer<DeleteByQueryRequest.Builder> op)
-