Class UpdateDescriptor<TDocument, TPartialDocument>
Descriptor for Update
https://opensearch.org/docs/latest/opensearch/rest-api/document-apis/update-document/
Inheritance
UpdateDescriptor<TDocument, TPartialDocument>
Assembly: OpenSearch.Client.dll
Syntax
public class UpdateDescriptor<TDocument, TPartialDocument> : RequestDescriptorBase<UpdateDescriptor<TDocument, TPartialDocument>, UpdateRequestParameters, IUpdateRequest<TDocument, TPartialDocument>>, IDescriptor, IUpdateRequest<TDocument, TPartialDocument>, IRequest<UpdateRequestParameters>, IRequest where TDocument : class where TPartialDocument : class
Type Parameters
Name |
Description |
TDocument |
|
TPartialDocument |
|
Constructors
|
Edit this page
View Source
UpdateDescriptor()
Used for serialization purposes, making sure we have a parameterless constructor
Declaration
protected UpdateDescriptor()
|
Edit this page
View Source
UpdateDescriptor(Id)
Declaration
public UpdateDescriptor(Id id)
Parameters
Type |
Name |
Description |
Id |
id |
this parameter is required
|
|
Edit this page
View Source
UpdateDescriptor(IndexName, Id)
Declaration
public UpdateDescriptor(IndexName index, Id id)
Parameters
Type |
Name |
Description |
IndexName |
index |
this parameter is required
|
Id |
id |
this parameter is required
|
|
Edit this page
View Source
UpdateDescriptor(TDocument, IndexName, Id)
Declaration
public UpdateDescriptor(TDocument documentWithId, IndexName index = null, Id id = null)
Parameters
Type |
Name |
Description |
TDocument |
documentWithId |
|
IndexName |
index |
|
Id |
id |
The document used to resolve the path from
|
Methods
|
Edit this page
View Source
DetectNoop(bool?)
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> DetectNoop(bool? detectNoop = true)
Parameters
Type |
Name |
Description |
bool? |
detectNoop |
|
Returns
|
Edit this page
View Source
Doc(TPartialDocument)
The partial update document to be merged on to the existing object.
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> Doc(TPartialDocument @object)
Parameters
Type |
Name |
Description |
TPartialDocument |
object |
|
Returns
|
Edit this page
View Source
DocAsUpsert(bool?)
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> DocAsUpsert(bool? docAsUpsert = true)
Parameters
Type |
Name |
Description |
bool? |
docAsUpsert |
|
Returns
|
Edit this page
View Source
IfPrimaryTerm(long?)
only perform the update operation if the last operation that has changed the document has the specified primary term
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> IfPrimaryTerm(long? ifprimaryterm)
Parameters
Type |
Name |
Description |
long? |
ifprimaryterm |
|
Returns
|
Edit this page
View Source
IfSequenceNumber(long?)
only perform the update operation if the last operation that has changed the document has the specified sequence number
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> IfSequenceNumber(long? ifsequencenumber)
Parameters
Type |
Name |
Description |
long? |
ifsequencenumber |
|
Returns
|
Edit this page
View Source
Index(IndexName)
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> Index(IndexName index)
Parameters
Returns
|
Edit this page
View Source
Index<TOther>()
a shortcut into calling Index(typeof(TOther))
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> Index<TOther>() where TOther : class
Returns
Type Parameters
|
Edit this page
View Source
Lang(string)
The script language (default: painless)
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> Lang(string lang)
Parameters
Type |
Name |
Description |
string |
lang |
|
Returns
|
Edit this page
View Source
Refresh(Refresh?)
If true
then refresh the affected shards to make this operation visible to search, if wait_for
then wait for a refresh to make this operation visible to search, if false
(the default) then do nothing with refreshes.
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> Refresh(Refresh? refresh)
Parameters
Type |
Name |
Description |
Refresh? |
refresh |
|
Returns
|
Edit this page
View Source
RequireAlias(bool?)
When true, requires destination is an alias. Default is false
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> RequireAlias(bool? requirealias = true)
Parameters
Type |
Name |
Description |
bool? |
requirealias |
|
Returns
|
Edit this page
View Source
RetryOnConflict(long?)
Specify how many times should the operation be retried when a conflict occurs (default: 0)
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> RetryOnConflict(long? retryonconflict)
Parameters
Type |
Name |
Description |
long? |
retryonconflict |
|
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 UpdateDescriptor<TDocument, TPartialDocument> Routing(Routing routing)
Parameters
Type |
Name |
Description |
Routing |
routing |
|
Returns
|
Edit this page
View Source
Script(Func<ScriptDescriptor, IScript>)
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> Script(Func<ScriptDescriptor, IScript> scriptSelector)
Parameters
Returns
|
Edit this page
View Source
ScriptedUpsert(bool?)
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> ScriptedUpsert(bool? scriptedUpsert = true)
Parameters
Type |
Name |
Description |
bool? |
scriptedUpsert |
|
Returns
|
Edit this page
View Source
Source(Func<SourceFilterDescriptor<TDocument>, ISourceFilter>)
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> Source(Func<SourceFilterDescriptor<TDocument>, ISourceFilter> selector)
Parameters
Returns
|
Edit this page
View Source
Source(bool?)
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> Source(bool? enabled = true)
Parameters
Type |
Name |
Description |
bool? |
enabled |
|
Returns
|
Edit this page
View Source
SourceEnabled(bool?)
Whether the _source should be included in the response.
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> SourceEnabled(bool? sourceenabled = true)
Parameters
Type |
Name |
Description |
bool? |
sourceenabled |
|
Returns
|
Edit this page
View Source
Timeout(Time)
Explicit operation timeout
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> Timeout(Time timeout)
Parameters
Type |
Name |
Description |
Time |
timeout |
|
Returns
|
Edit this page
View Source
Upsert(TDocument)
The full document to be created if an existing document does not exist for a partial merge.
Declaration
public UpdateDescriptor<TDocument, TPartialDocument> Upsert(TDocument upsertObject)
Parameters
Type |
Name |
Description |
TDocument |
upsertObject |
|
Returns
|
Edit this page
View Source
WaitForActiveShards(string)
Sets the number of shard copies that must be active before proceeding with the update 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 UpdateDescriptor<TDocument, TPartialDocument> WaitForActiveShards(string waitforactiveshards)
Parameters
Type |
Name |
Description |
string |
waitforactiveshards |
|
Returns
Implements
Extension Methods