Class UpdateByQueryDescriptor<TDocument>
Descriptor for UpdateByQuery
https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-by-query/
Inheritance
UpdateByQueryDescriptor<TDocument>
Assembly: OpenSearch.Client.dll
Syntax
public class UpdateByQueryDescriptor<TDocument> : RequestDescriptorBase<UpdateByQueryDescriptor<TDocument>, UpdateByQueryRequestParameters, IUpdateByQueryRequest<TDocument>>, IDescriptor, IUpdateByQueryRequest<TDocument>, IUpdateByQueryRequest, IRequest<UpdateByQueryRequestParameters>, IRequest where TDocument : class
Type Parameters
Name |
Description |
TDocument |
|
Constructors
|
Edit this page
View Source
UpdateByQueryDescriptor()
/{index}/_update_by_query
Declaration
public UpdateByQueryDescriptor()
|
Edit this page
View Source
UpdateByQueryDescriptor(Indices)
/{index}/_update_by_query
Declaration
public UpdateByQueryDescriptor(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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<TDocument> Analyzer(string analyzer)
Parameters
Type |
Name |
Description |
string |
analyzer |
|
Returns
|
Edit this page
View Source
Conflicts(Conflicts?)
What to do when the update by query hits version conflicts?
Declaration
public UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<TDocument> ExpandWildcards(ExpandWildcards? expandwildcards)
Parameters
Returns
|
Edit this page
View Source
From(long?)
Starting offset (default: 0)
Declaration
public UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<TDocument> Lenient(bool? lenient = true)
Parameters
Type |
Name |
Description |
bool? |
lenient |
|
Returns
|
Edit this page
View Source
MatchAll()
Query that selects all documents
Declaration
public UpdateByQueryDescriptor<TDocument> MatchAll()
Returns
|
Edit this page
View Source
MaximumDocuments(long?)
Limit the number of processed documents
Declaration
public UpdateByQueryDescriptor<TDocument> MaximumDocuments(long? maximumDocuments)
Parameters
Type |
Name |
Description |
long? |
maximumDocuments |
|
Returns
|
Edit this page
View Source
Pipeline(string)
Ingest pipeline to set on index requests made by this action. (default: none)
Declaration
public UpdateByQueryDescriptor<TDocument> Pipeline(string pipeline)
Parameters
Type |
Name |
Description |
string |
pipeline |
|
Returns
|
Edit this page
View Source
Preference(string)
Specify the node or shard the operation should be performed on (default: random)
Declaration
public UpdateByQueryDescriptor<TDocument> Preference(string preference)
Parameters
Type |
Name |
Description |
string |
preference |
|
Returns
|
Edit this page
View Source
Query(Func<QueryContainerDescriptor<TDocument>, QueryContainer>)
Query to select documents to update
Declaration
public UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<TDocument> QueryOnQueryString(string queryonquerystring)
Parameters
Type |
Name |
Description |
string |
queryonquerystring |
|
Returns
|
Edit this page
View Source
Refresh(bool?)
Should the affected indexes be refreshed?
Declaration
public UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<TDocument> RequestCache(bool? requestcache = true)
Parameters
Type |
Name |
Description |
bool? |
requestcache |
|
Returns
|
Edit this page
View Source
RequestsPerSecond(long?)
The throttle to set on this request in sub-requests per second. -1 means no throttle.
Declaration
public UpdateByQueryDescriptor<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 OSC 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 UpdateByQueryDescriptor<TDocument> Routing(Routing routing)
Parameters
Type |
Name |
Description |
Routing |
routing |
|
Returns
|
Edit this page
View Source
Script(Func<ScriptDescriptor, IScript>)
A script specifying the update to make
Declaration
public UpdateByQueryDescriptor<TDocument> Script(Func<ScriptDescriptor, IScript> scriptSelector)
Parameters
Returns
|
Edit this page
View Source
Script(string)
A script specifying the update to make
Declaration
public UpdateByQueryDescriptor<TDocument> Script(string script)
Parameters
Type |
Name |
Description |
string |
script |
|
Returns
|
Edit this page
View Source
Specify how long a consistent view of the index should be maintained for scrolled search
Declaration
public UpdateByQueryDescriptor<TDocument> Scroll(Time scroll)
Parameters
Type |
Name |
Description |
Time |
scroll |
|
Returns
|
Edit this page
View Source
Size on the scroll request powering the update by query
Declaration
public UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<TDocument> SearchTimeout(Time searchtimeout)
Parameters
Type |
Name |
Description |
Time |
searchtimeout |
|
Returns
|
Edit this page
View Source
SearchType(SearchType?)
Declaration
public UpdateByQueryDescriptor<TDocument> SearchType(SearchType? searchtype)
Parameters
Returns
|
Edit this page
View Source
Parallelize the update process by splitting a query into
multiple slices.
Declaration
public UpdateByQueryDescriptor<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. Can be set to auto
.
Declaration
public UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<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 UpdateByQueryDescriptor<TDocument> Version(bool? version = true)
Parameters
Type |
Name |
Description |
bool? |
version |
|
Returns
|
Edit this page
View Source
VersionType(bool?)
Should the document increment the version number (internal) on hit or not (reindex)
Declaration
public UpdateByQueryDescriptor<TDocument> VersionType(bool? versiontype = true)
Parameters
Type |
Name |
Description |
bool? |
versiontype |
|
Returns
|
Edit this page
View Source
WaitForActiveShards(string)
Sets the number of shard copies that must be active before proceeding with the update 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 UpdateByQueryDescriptor<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 update by query operation is complete.
Declaration
public UpdateByQueryDescriptor<TDocument> WaitForCompletion(bool? waitforcompletion = true)
Parameters
Type |
Name |
Description |
bool? |
waitforcompletion |
|
Returns
Implements
Extension Methods