Class DeleteByQueryRequest
Delete documents that match a given query
Inheritance
Inherited Members
Namespace: OpenSearch.Client
Assembly: OpenSearch.Client.dll
Syntax
public class DeleteByQueryRequest : PlainRequestBase<DeleteByQueryRequestParameters>, IDeleteByQueryRequest, IRequest<DeleteByQueryRequestParameters>, IRequest
Constructors
| Edit this page View SourceDeleteByQueryRequest()
Used for serialization purposes, making sure we have a parameterless constructor
Declaration
protected DeleteByQueryRequest()
DeleteByQueryRequest(Indices)
/{index}/_delete_by_query
Declaration
public DeleteByQueryRequest(Indices index)
Parameters
Type | Name | Description |
---|---|---|
Indices | index | this parameter is required |
Properties
| Edit this page View SourceAllowNoIndices
If false
, the request returns an error if any wildcard expression, index alias, or _all
value targets only missing or closed indexes.
This behavior applies even if the request targets other open indexes. For example, a request targeting foo*,bar*
returns an error if an
index starts with foo
but no index starts with bar
.
Declaration
public bool? AllowNoIndices { get; set; }
Property Value
Type | Description |
---|---|
bool? |
AnalyzeWildcard
If true
, wildcard and prefix queries are analyzed.
Declaration
public bool? AnalyzeWildcard { get; set; }
Property Value
Type | Description |
---|---|
bool? |
Analyzer
Analyzer to use for the query string.
Declaration
public string Analyzer { get; set; }
Property Value
Type | Description |
---|---|
string |
Conflicts
What to do if delete by query hits version conflicts: abort
or proceed
.
Declaration
public Conflicts? Conflicts { get; set; }
Property Value
Type | Description |
---|---|
Conflicts? |
DefaultOperator
The default operator for query string query: AND
or OR
.
Declaration
public DefaultOperator? DefaultOperator { get; set; }
Property Value
Type | Description |
---|---|
DefaultOperator? |
Df
Field to use as default where no field prefix is given in the query string.
Declaration
public string Df { get; set; }
Property Value
Type | Description |
---|---|
string |
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 as open,hidden
. Valid values are: all
, open
, closed
,
hidden
, none
.
Declaration
public ExpandWildcards? ExpandWildcards { get; set; }
Property Value
Type | Description |
---|---|
ExpandWildcards? |
From
Starting offset.
Declaration
public long? From { get; set; }
Property Value
Type | Description |
---|---|
long? |
IgnoreUnavailable
If false
, the request returns an error if it targets a missing or closed index.
Declaration
public bool? IgnoreUnavailable { get; set; }
Property Value
Type | Description |
---|---|
bool? |
Lenient
If true
, format-based query failures (such as providing text to a numeric field) in the query string will be ignored.
Declaration
public bool? Lenient { get; set; }
Property Value
Type | Description |
---|---|
bool? |
MaximumDocuments
Limit the number of processed documents
Declaration
public long? MaximumDocuments { get; set; }
Property Value
Type | Description |
---|---|
long? |
Preference
Specifies the node or shard the operation should be performed on. Random by default.
Declaration
public string Preference { get; set; }
Property Value
Type | Description |
---|---|
string |
Query
The query to use to select documents for deletion
Declaration
public QueryContainer Query { get; set; }
Property Value
Type | Description |
---|---|
QueryContainer |
QueryOnQueryString
Query in the Lucene query string syntax.
Declaration
public string QueryOnQueryString { get; set; }
Property Value
Type | Description |
---|---|
string |
Refresh
If true
, OpenSearch refreshes all shards involved in the delete by query after the request completes.
Declaration
public Refresh? Refresh { get; set; }
Property Value
Type | Description |
---|---|
Refresh? |
RequestCache
If true
, the request cache is used for this request. Defaults to the index-level setting.
Declaration
public bool? RequestCache { get; set; }
Property Value
Type | Description |
---|---|
bool? |
RequestsPerSecond
The throttle for this request in sub-requests per second.
Declaration
public long? RequestsPerSecond { get; set; }
Property Value
Type | Description |
---|---|
long? |
Routing
A document is routed to a particular shard in an index using the following formula
shard_num = hash(_routing) % num_primary_shards
OpenSearch will use the document id if not provided.
For requests that are constructed from/for a document OpenSearch.Client will automatically infer the routing key if that document has a JoinField or a routing mapping on for its type exists on ConnectionSettings
Declaration
public Routing Routing { get; set; }
Property Value
Type | Description |
---|---|
Routing |
Scroll
Period to retain the search context for scrolling.
Declaration
public Time Scroll { get; set; }
Property Value
Type | Description |
---|---|
Time |
ScrollSize
Size of the scroll request that powers the operation.
Declaration
public long? ScrollSize { get; set; }
Property Value
Type | Description |
---|---|
long? |
SearchTimeout
Explicit timeout for each search request. Defaults to no timeout.
Declaration
public Time SearchTimeout { get; set; }
Property Value
Type | Description |
---|---|
Time |
SearchType
The type of the search operation. Available options: query_then_fetch
, dfs_query_then_fetch
.
Declaration
public SearchType? SearchType { get; set; }
Property Value
Type | Description |
---|---|
SearchType? |
Self
Declaration
protected IDeleteByQueryRequest Self { get; }
Property Value
Type | Description |
---|---|
IDeleteByQueryRequest |
Size
Deprecated, use max_docs
instead.
Declaration
public long? Size { get; set; }
Property Value
Type | Description |
---|---|
long? |
Slice
Parallelize the deleting process. This parallelization can improve efficiency and provide a convenient way to break the request down into smaller parts.
Declaration
public ISlicedScroll Slice { get; set; }
Property Value
Type | Description |
---|---|
ISlicedScroll |
Slices
The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks.
Declaration
public Slices Slices { get; set; }
Property Value
Type | Description |
---|---|
Slices |
Sort
A comma-separated list of <field>:<direction> pairs.
Declaration
public string[] Sort { get; set; }
Property Value
Type | Description |
---|---|
string[] |
SourceEnabled
Whether the _source should be included in the response.
Declaration
public bool? SourceEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool? |
SourceExcludes
List of fields to exclude from the returned _source
field.
Declaration
public Fields SourceExcludes { get; set; }
Property Value
Type | Description |
---|---|
Fields |
SourceIncludes
List of fields to extract and return from the _source
field.
Declaration
public Fields SourceIncludes { get; set; }
Property Value
Type | Description |
---|---|
Fields |
Stats
Specific tag
of the request for logging and statistical purposes.
Declaration
public string[] Stats { get; set; }
Property Value
Type | Description |
---|---|
string[] |
TerminateAfter
Maximum number of documents to collect for each shard. If a query reaches this limit, OpenSearch terminates the query early. OpenSearch collects documents before sorting. Use with caution. OpenSearch applies this parameter to each shard handling the request. When possible, let OpenSearch perform early termination automatically. Avoid specifying this parameter for requests that target data streams with backing indexes across multiple data tiers.
Declaration
public long? TerminateAfter { get; set; }
Property Value
Type | Description |
---|---|
long? |
Timeout
Period each deletion request waits for active shards.
Declaration
public Time Timeout { get; set; }
Property Value
Type | Description |
---|---|
Time |
Version
If true
, returns the document version as part of a hit.
Declaration
public bool? Version { get; set; }
Property Value
Type | Description |
---|---|
bool? |
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
).
Declaration
public string WaitForActiveShards { get; set; }
Property Value
Type | Description |
---|---|
string |
WaitForCompletion
If true
, the request blocks until the operation is complete.
Declaration
public bool? WaitForCompletion { get; set; }
Property Value
Type | Description |
---|---|
bool? |