Search Results for

    Show / Hide Table of Contents

    Class UpdateRequest<TDocument, TPartialDocument>

    Request for Update

    https://opensearch.org/docs/latest/api-reference/document-apis/update-document/

    Inheritance
    object
    RequestBase<UpdateRequestParameters>
    PlainRequestBase<UpdateRequestParameters>
    UpdateRequest<TDocument, TPartialDocument>
    Implements
    IUpdateRequest<TDocument, TPartialDocument>
    IRequest<UpdateRequestParameters>
    IRequest
    Inherited Members
    PlainRequestBase<UpdateRequestParameters>.RequestConfiguration
    PlainRequestBase<UpdateRequestParameters>.ErrorTrace
    PlainRequestBase<UpdateRequestParameters>.FilterPath
    PlainRequestBase<UpdateRequestParameters>.Human
    PlainRequestBase<UpdateRequestParameters>.Pretty
    PlainRequestBase<UpdateRequestParameters>.SourceQueryString
    RequestBase<UpdateRequestParameters>.HttpMethod
    RequestBase<UpdateRequestParameters>.RequestState
    RequestBase<UpdateRequestParameters>.ContentType
    RequestBase<UpdateRequestParameters>.ResolveUrl(RouteValues, IConnectionSettingsValues)
    RequestBase<UpdateRequestParameters>.RequestDefaults(UpdateRequestParameters)
    RequestBase<UpdateRequestParameters>.Q<TOut>(string)
    RequestBase<UpdateRequestParameters>.Q(string, object)
    RequestBase<UpdateRequestParameters>.SetAcceptHeader(string)
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: OpenSearch.Client
    Assembly: OpenSearch.Client.dll
    Syntax
    public class UpdateRequest<TDocument, TPartialDocument> : PlainRequestBase<UpdateRequestParameters>, IUpdateRequest<TDocument, TPartialDocument>, IRequest<UpdateRequestParameters>, IRequest where TDocument : class where TPartialDocument : class
    Type Parameters
    Name Description
    TDocument
    TPartialDocument

    Constructors

    | Edit this page View Source

    UpdateRequest()

    Used for serialization purposes, making sure we have a parameterless constructor

    Declaration
    protected UpdateRequest()
    | Edit this page View Source

    UpdateRequest(Id)

    /{index}/_update/{id}

    Declaration
    public UpdateRequest(Id id)
    Parameters
    Type Name Description
    Id id

    this parameter is required

    | Edit this page View Source

    UpdateRequest(IndexName, Id)

    /{index}/_update/{id}

    Declaration
    public UpdateRequest(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

    UpdateRequest(TDocument, IndexName, Id)

    /{index}/_update/{id}

    Declaration
    public UpdateRequest(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

    Properties

    | Edit this page View Source

    DetectNoop

    Declaration
    public bool? DetectNoop { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    Doc

    Declaration
    public TPartialDocument Doc { get; set; }
    Property Value
    Type Description
    TPartialDocument
    | Edit this page View Source

    DocAsUpsert

    Declaration
    public bool? DocAsUpsert { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    IfPrimaryTerm

    Only perform the operation if the document has this primary term.

    Declaration
    public long? IfPrimaryTerm { get; set; }
    Property Value
    Type Description
    long?
    | Edit this page View Source

    IfSequenceNumber

    Only perform the operation if the document has this sequence number.

    Declaration
    public long? IfSequenceNumber { get; set; }
    Property Value
    Type Description
    long?
    | Edit this page View Source

    Lang

    The script language.

    Declaration
    public string Lang { get; set; }
    Property Value
    Type Description
    string
    | Edit this page View Source

    Refresh

    If 'true', OpenSearch refreshes 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 do nothing with refreshes.

    Declaration
    public Refresh? Refresh { get; set; }
    Property Value
    Type Description
    Refresh?
    | Edit this page View Source

    RequireAlias

    If true, the destination must be an index alias.

    Declaration
    public bool? RequireAlias { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    RetryOnConflict

    Specify how many times should the operation be retried when a conflict occurs.

    Declaration
    public int? RetryOnConflict { get; set; }
    Property Value
    Type Description
    int?
    | Edit this page View Source

    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
    | Edit this page View Source

    Script

    Declaration
    public IScript Script { get; set; }
    Property Value
    Type Description
    IScript
    | Edit this page View Source

    ScriptedUpsert

    If you would like your script to run regardless of whether the document exists or not — i.e. the script handles initializing the document instead of the upsert element — then set scripted_upsert to true

    Declaration
    public bool? ScriptedUpsert { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    Self

    Declaration
    protected IUpdateRequest<TDocument, TPartialDocument> Self { get; }
    Property Value
    Type Description
    IUpdateRequest<TDocument, TPartialDocument>
    | Edit this page View Source

    Source

    Declaration
    public Union<bool, ISourceFilter> Source { get; set; }
    Property Value
    Type Description
    Union<bool, ISourceFilter>
    | Edit this page View Source

    SourceEnabled

    Whether the _source should be included in the response.

    Declaration
    public bool? SourceEnabled { get; set; }
    Property Value
    Type Description
    bool?
    | Edit this page View Source

    Timeout

    Period to wait for dynamic mapping updates and active shards. This guarantees OpenSearch waits for at least the timeout before failing. The actual wait time could be longer, particularly when multiple waits occur.

    Declaration
    public Time Timeout { get; set; }
    Property Value
    Type Description
    Time
    | Edit this page View Source

    Upsert

    Declaration
    public TDocument Upsert { get; set; }
    Property Value
    Type Description
    TDocument
    | Edit this page View Source

    WaitForActiveShards

    The number of shard copies that must be active before proceeding with the operations. Set to 'all' or any positive integer up to the total number of shards in the index (number_of_replicas+1). Defaults to 1 meaning the primary shard.

    Declaration
    public string WaitForActiveShards { get; set; }
    Property Value
    Type Description
    string

    Implements

    IUpdateRequest<TDocument, TPartialDocument>
    IRequest<TParameters>
    IRequest

    Extension Methods

    SuffixExtensions.Suffix(object, string)
    • Edit this page
    • View Source
    In this article
    • Constructors
      • UpdateRequest()
      • UpdateRequest(Id)
      • UpdateRequest(IndexName, Id)
      • UpdateRequest(TDocument, IndexName, Id)
    • Properties
      • DetectNoop
      • Doc
      • DocAsUpsert
      • IfPrimaryTerm
      • IfSequenceNumber
      • Lang
      • Refresh
      • RequireAlias
      • RetryOnConflict
      • Routing
      • Script
      • ScriptedUpsert
      • Self
      • Source
      • SourceEnabled
      • Timeout
      • Upsert
      • WaitForActiveShards
    • Implements
    • Extension Methods
    Back to top Generated by DocFX