Class DeleteByQueryDescriptor<TDocument>
Descriptor for DeleteByQuery
https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/delete-by-query/
Inheritance
DeleteByQueryDescriptor<TDocument>
Assembly: OpenSearch.Client.dll
Syntax
public class DeleteByQueryDescriptor<TDocument> : RequestDescriptorBase<DeleteByQueryDescriptor<TDocument>, DeleteByQueryRequestParameters, IDeleteByQueryRequest<TDocument>>, IDescriptor, IDeleteByQueryRequest<TDocument>, IDeleteByQueryRequest, IRequest<DeleteByQueryRequestParameters>, IRequest where TDocument : class
Type Parameters
Name |
Description |
TDocument |
|
Constructors
|
Edit this page
View Source
DeleteByQueryDescriptor()
/{index}/_delete_by_query
Declaration
public DeleteByQueryDescriptor()
|
Edit this page
View Source
DeleteByQueryDescriptor(Indices)
/{index}/_delete_by_query
Declaration
public DeleteByQueryDescriptor(Indices index)
Parameters
Type |
Name |
Description |
Indices |
index |
this parameter is required
|
Methods
|
Edit this page
View Source
AllIndices()
A shortcut into calling Index(Indices.All)
Declaration
public DeleteByQueryDescriptor<TDocument> AllIndices()
Returns
|
Edit this page
View Source
AllowNoIndices(bool?)
Whether to ignore if a wildcard indices expression resolves into no concrete indices. (This includes _all
string or when no indices have been specified)
Declaration
public DeleteByQueryDescriptor<TDocument> AllowNoIndices(bool? allownoindices = true)
Parameters
Type |
Name |
Description |
bool? |
allownoindices |
|
Returns
|
Edit this page
View Source
AnalyzeWildcard(bool?)
Specify whether wildcard and prefix queries should be analyzed (default: false)
Declaration
public DeleteByQueryDescriptor<TDocument> AnalyzeWildcard(bool? analyzewildcard = true)
Parameters
Type |
Name |
Description |
bool? |
analyzewildcard |
|
Returns
|
Edit this page
View Source
Analyzer(string)
The analyzer to use for the query string
Declaration
public DeleteByQueryDescriptor<TDocument> Analyzer(string analyzer)
Parameters
Type |
Name |
Description |
string |
analyzer |
|
Returns
|
Edit this page
View Source
Conflicts(Conflicts?)
What to do when the delete by query hits version conflicts?
Declaration
public DeleteByQueryDescriptor<TDocument> Conflicts(Conflicts? conflicts)
Parameters
Returns
|
Edit this page
View Source
DefaultOperator(DefaultOperator?)
The default operator for query string query (AND or OR)
Declaration
public DeleteByQueryDescriptor<TDocument> DefaultOperator(DefaultOperator? defaultoperator)
Parameters
Returns
|
Edit this page
View Source
Df(string)
The field to use as default where no field prefix is given in the query string
Declaration
public DeleteByQueryDescriptor<TDocument> Df(string df)
Parameters
Type |
Name |
Description |
string |
df |
|
Returns
|
Edit this page
View Source
ExpandWildcards(ExpandWildcards?)
Whether to expand wildcard expression to concrete indices that are open, closed or both.
Declaration
public DeleteByQueryDescriptor<TDocument> ExpandWildcards(ExpandWildcards? expandwildcards)
Parameters
Returns
|
Edit this page
View Source
From(long?)
Starting offset (default: 0)
Declaration
public DeleteByQueryDescriptor<TDocument> From(long? from)
Parameters
Type |
Name |
Description |
long? |
from |
|
Returns
|
Edit this page
View Source
IgnoreUnavailable(bool?)
Whether specified concrete indices should be ignored when unavailable (missing or closed)
Declaration
public DeleteByQueryDescriptor<TDocument> IgnoreUnavailable(bool? ignoreunavailable = true)
Parameters
Type |
Name |
Description |
bool? |
ignoreunavailable |
|
Returns
|
Edit this page
View Source
Index(Indices)
A comma-separated list of index names to search; use the special string _all
or Indices.All to perform the operation on all indices
Declaration
public DeleteByQueryDescriptor<TDocument> Index(Indices index)
Parameters
Type |
Name |
Description |
Indices |
index |
|
Returns
|
Edit this page
View Source
Index<TOther>()
a shortcut into calling Index(typeof(TOther))
Declaration
public DeleteByQueryDescriptor<TDocument> Index<TOther>() where TOther : class
Returns
Type Parameters
|
Edit this page
View Source
Lenient(bool?)
Specify whether format-based query failures (such as providing text to a numeric field) should be ignored
Declaration
public DeleteByQueryDescriptor<TDocument> Lenient(bool? lenient = true)
Parameters
Type |
Name |
Description |
bool? |
lenient |
|
Returns
|
Edit this page
View Source
MatchAll()
Declaration
public DeleteByQueryDescriptor<TDocument> MatchAll()
Returns
|
Edit this page
View Source
MaximumDocuments(long?)
Limit the number of processed documents
Declaration
public DeleteByQueryDescriptor<TDocument> MaximumDocuments(long? maximumDocuments)
Parameters
Type |
Name |
Description |
long? |
maximumDocuments |
|
Returns
|
Edit this page
View Source
Preference(string)
Specify the node or shard the operation should be performed on (default: random)
Declaration
public DeleteByQueryDescriptor<TDocument> Preference(string preference)
Parameters
Type |
Name |
Description |
string |
preference |
|
Returns
|
Edit this page
View Source
Query(Func<QueryContainerDescriptor<TDocument>, QueryContainer>)
The query to use to select documents for deletion
Declaration
public DeleteByQueryDescriptor<TDocument> Query(Func<QueryContainerDescriptor<TDocument>, QueryContainer> querySelector)
Parameters
Returns
|
Edit this page
View Source
QueryOnQueryString(string)
Query in the Lucene query string syntax
Declaration
public DeleteByQueryDescriptor<TDocument> QueryOnQueryString(string queryonquerystring)
Parameters
Type |
Name |
Description |
string |
queryonquerystring |
|
Returns
|
Edit this page
View Source
Refresh(bool?)
Should the effected indexes be refreshed?
Declaration
public DeleteByQueryDescriptor<TDocument> Refresh(bool? refresh = true)
Parameters
Type |
Name |
Description |
bool? |
refresh |
|
Returns
|
Edit this page
View Source
RequestCache(bool?)
Specify if request cache should be used for this request or not, defaults to index level setting
Declaration
public DeleteByQueryDescriptor<TDocument> RequestCache(bool? requestcache = true)
Parameters
Type |
Name |
Description |
bool? |
requestcache |
|
Returns
|
Edit this page
View Source
RequestsPerSecond(long?)
The throttle for this request in sub-requests per second. -1 means no throttle.
Declaration
public DeleteByQueryDescriptor<TDocument> RequestsPerSecond(long? requestspersecond)
Parameters
Type |
Name |
Description |
long? |
requestspersecond |
|
Returns
|
Edit this page
View Source
Routing(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 DeleteByQueryDescriptor<TDocument> Routing(Routing routing)
Parameters
Type |
Name |
Description |
Routing |
routing |
|
Returns
|
Edit this page
View Source
Specify how long a consistent view of the index should be maintained for scrolled search
Declaration
public DeleteByQueryDescriptor<TDocument> Scroll(Time scroll)
Parameters
Type |
Name |
Description |
Time |
scroll |
|
Returns
|
Edit this page
View Source
Size on the scroll request powering the delete by query
Declaration
public DeleteByQueryDescriptor<TDocument> ScrollSize(long? scrollsize)
Parameters
Type |
Name |
Description |
long? |
scrollsize |
|
Returns
|
Edit this page
View Source
SearchTimeout(Time)
Explicit timeout for each search request. Defaults to no timeout.
Declaration
public DeleteByQueryDescriptor<TDocument> SearchTimeout(Time searchtimeout)
Parameters
Type |
Name |
Description |
Time |
searchtimeout |
|
Returns
|
Edit this page
View Source
SearchType(SearchType?)
Declaration
public DeleteByQueryDescriptor<TDocument> SearchType(SearchType? searchtype)
Parameters
Returns
|
Edit this page
View Source
Parallelize the deleting process. This parallelization can improve efficiency and
provide a convenient way to break the request down into smaller parts.
Declaration
public DeleteByQueryDescriptor<TDocument> Slice(Func<SlicedScrollDescriptor<TDocument>, ISlicedScroll> selector)
Parameters
Returns
|
Edit this page
View Source
Slices(Slices)
The number of slices this task should be divided into. Defaults to 1, meaning the task isn't sliced into subtasks.
Declaration
public DeleteByQueryDescriptor<TDocument> Slices(Slices slices)
Parameters
Type |
Name |
Description |
Slices |
slices |
|
Returns
|
Edit this page
View Source
Sort(params string[])
A comma-separated list of <field>:<direction> pairs
Declaration
public DeleteByQueryDescriptor<TDocument> Sort(params string[] sort)
Parameters
Type |
Name |
Description |
string[] |
sort |
|
Returns
|
Edit this page
View Source
SourceEnabled(bool?)
Whether the _source should be included in the response.
Declaration
public DeleteByQueryDescriptor<TDocument> SourceEnabled(bool? sourceenabled = true)
Parameters
Type |
Name |
Description |
bool? |
sourceenabled |
|
Returns
|
Edit this page
View Source
SourceExcludes(Fields)
A list of fields to exclude from the returned _source field
Declaration
public DeleteByQueryDescriptor<TDocument> SourceExcludes(Fields sourceexcludes)
Parameters
Type |
Name |
Description |
Fields |
sourceexcludes |
|
Returns
|
Edit this page
View Source
SourceExcludes(params Expression<Func<TDocument, object>>[])
A list of fields to exclude from the returned _source field
Declaration
public DeleteByQueryDescriptor<TDocument> SourceExcludes(params Expression<Func<TDocument, object>>[] fields)
Parameters
Returns
|
Edit this page
View Source
SourceIncludes(Fields)
A list of fields to extract and return from the _source field
Declaration
public DeleteByQueryDescriptor<TDocument> SourceIncludes(Fields sourceincludes)
Parameters
Type |
Name |
Description |
Fields |
sourceincludes |
|
Returns
|
Edit this page
View Source
SourceIncludes(params Expression<Func<TDocument, object>>[])
A list of fields to extract and return from the _source field
Declaration
public DeleteByQueryDescriptor<TDocument> SourceIncludes(params Expression<Func<TDocument, object>>[] fields)
Parameters
Returns
|
Edit this page
View Source
Stats(params string[])
Specific 'tag' of the request for logging and statistical purposes
Declaration
public DeleteByQueryDescriptor<TDocument> Stats(params string[] stats)
Parameters
Type |
Name |
Description |
string[] |
stats |
|
Returns
|
Edit this page
View Source
TerminateAfter(long?)
The maximum number of documents to collect for each shard, upon reaching which the query execution will terminate early.
Declaration
public DeleteByQueryDescriptor<TDocument> TerminateAfter(long? terminateafter)
Parameters
Type |
Name |
Description |
long? |
terminateafter |
|
Returns
|
Edit this page
View Source
Timeout(Time)
Time each individual bulk request should wait for shards that are unavailable.
Declaration
public DeleteByQueryDescriptor<TDocument> Timeout(Time timeout)
Parameters
Type |
Name |
Description |
Time |
timeout |
|
Returns
|
Edit this page
View Source
Version(bool?)
Specify whether to return document version as part of a hit
Declaration
public DeleteByQueryDescriptor<TDocument> Version(bool? version = true)
Parameters
Type |
Name |
Description |
bool? |
version |
|
Returns
|
Edit this page
View Source
WaitForActiveShards(string)
Sets the number of shard copies that must be active before proceeding with the delete by query operation. Defaults to 1, meaning the primary shard only. Set to all
for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1)
Declaration
public DeleteByQueryDescriptor<TDocument> WaitForActiveShards(string waitforactiveshards)
Parameters
Type |
Name |
Description |
string |
waitforactiveshards |
|
Returns
|
Edit this page
View Source
WaitForCompletion(bool?)
Should the request should block until the delete by query is complete.
Declaration
public DeleteByQueryDescriptor<TDocument> WaitForCompletion(bool? waitforcompletion = true)
Parameters
Type |
Name |
Description |
bool? |
waitforcompletion |
|
Returns
Implements
Extension Methods